Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
feab941
WIP identity in git
MichaelMure Nov 21, 2018
06d9c68
identity: implement the loading from git
MichaelMure Jan 16, 2019
3df4f46
identity: add metadata support
MichaelMure Jan 17, 2019
bdbe9e7
identity: more progress and fixes
MichaelMure Jan 17, 2019
844616b
identity: more progress and fixes
MichaelMure Jan 19, 2019
d10c764
identity: somewhat getting closer !
MichaelMure Jan 19, 2019
14b240a
identity: more cleaning and fixes after a code review
MichaelMure Jan 20, 2019
56c6147
identity: more refactoring progress
MichaelMure Feb 1, 2019
328a4e5
identity: wip push/pull
MichaelMure Feb 3, 2019
21048e7
identity: wip
MichaelMure Feb 6, 2019
cd7ed7f
identity: add more test for serialisation and push/pull/merge + fixes
MichaelMure Feb 16, 2019
d2483d8
identity: I can compile again !!
MichaelMure Feb 16, 2019
da558b0
identity: all tests green o/
MichaelMure Feb 16, 2019
864eae0
identity: work on higher level now, cache, first two identity commands
MichaelMure Feb 17, 2019
976af3a
identity: fix tests
MichaelMure Feb 17, 2019
947ea63
identity: wip caching
MichaelMure Feb 18, 2019
54f9838
identity: working identity cache
MichaelMure Feb 18, 2019
ffe35fe
identity: complete the graphql api
MichaelMure Feb 18, 2019
71f9290
identity: store the times properly
MichaelMure Feb 18, 2019
7193032
identity: fix tests
MichaelMure Feb 19, 2019
b8caddd
identity: some UX cleanup
MichaelMure Feb 23, 2019
dc1edf8
generator cleanup
MichaelMure Feb 23, 2019
839b241
git: fix RmConfigs
MichaelMure Feb 23, 2019
ecf857a
makefile: add the clean-local-identities target for debugging
MichaelMure Feb 23, 2019
b59623a
bridge: fix typo
MichaelMure Feb 24, 2019
e100ee9
github: fix 3 edge-case failures
MichaelMure Feb 24, 2019
268f617
github: simplify some code
MichaelMure Feb 24, 2019
8bba6d1
cache: fix ResolveIdentityImmutableMetadata byt storing metadata in I…
MichaelMure Feb 24, 2019
7a80d8f
commands: add a super-fast "user ls" command
MichaelMure Feb 24, 2019
304a334
commands: add a "user adopt" command to use an existing identity
MichaelMure Feb 24, 2019
2fd5f71
commands: add a "." at the end of Short commands usage
MichaelMure Feb 24, 2019
475b7b4
a round of cleanup
MichaelMure Feb 24, 2019
46beb4b
identity: another round of cleanups
MichaelMure Feb 24, 2019
c235d89
commands: show the last modification time in "user"
MichaelMure Feb 24, 2019
bad05a4
cache: better API to access excerpts
MichaelMure Feb 26, 2019
f6eb838
commands: "user ls" also show metadata
MichaelMure Feb 26, 2019
782576f
update generated files
MichaelMure Mar 1, 2019
b6bed78
github: fix potential bug due to var aliasing
MichaelMure Mar 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 1 addition & 37 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ debug-build:

install:
go generate
go install .
go install -ldflags "$(LDFLAGS)" .

test:
go test -bench=. ./...
Expand All @@ -30,14 +30,19 @@ pack-webui:

# produce a build that will fetch the web UI from the filesystem instead of from the binary
debug-webui:
go build -tags=debugwebui
go build -ldflags "$(LDFLAGS)" -tags=debugwebui

clean-local-bugs:
git for-each-ref refs/bugs/ | cut -f 2 | xargs -r -n 1 git update-ref -d
git for-each-ref refs/remotes/origin/bugs/ | cut -f 2 | xargs -r -n 1 git update-ref -d
rm -f .git/git-bug/cache
rm -f .git/git-bug/bug-cache

clean-remote-bugs:
git ls-remote origin "refs/bugs/*" | cut -f 2 | xargs -r git push origin -d

clean-local-identities:
git for-each-ref refs/identities/ | cut -f 2 | xargs -r -n 1 git update-ref -d
git for-each-ref refs/remotes/origin/identities/ | cut -f 2 | xargs -r -n 1 git update-ref -d
rm -f .git/git-bug/identity-cache

.PHONY: build install test pack-webui debug-webui clean-local-bugs clean-remote-bugs
18 changes: 10 additions & 8 deletions bridge/core/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import (
"github.com/pkg/errors"
)

var ErrImportNorSupported = errors.New("import is not supported")
var ErrExportNorSupported = errors.New("export is not supported")
var ErrImportNotSupported = errors.New("import is not supported")
var ErrExportNotSupported = errors.New("export is not supported")

const bridgeConfigKeyPrefix = "git-bug.bridge"

var bridgeImpl map[string]reflect.Type

Expand Down Expand Up @@ -114,12 +116,12 @@ func splitFullName(fullName string) (string, string, error) {
// ConfiguredBridges return the list of bridge that are configured for the given
// repo
func ConfiguredBridges(repo repository.RepoCommon) ([]string, error) {
configs, err := repo.ReadConfigs("git-bug.bridge.")
configs, err := repo.ReadConfigs(bridgeConfigKeyPrefix + ".")
if err != nil {
return nil, errors.Wrap(err, "can't read configured bridges")
}

re, err := regexp.Compile(`git-bug.bridge.([^.]+\.[^.]+)`)
re, err := regexp.Compile(bridgeConfigKeyPrefix + `.([^.]+\.[^.]+)`)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -266,7 +268,7 @@ func (b *Bridge) ensureInit() error {
func (b *Bridge) ImportAll() error {
importer := b.getImporter()
if importer == nil {
return ErrImportNorSupported
return ErrImportNotSupported
}

err := b.ensureConfig()
Expand All @@ -285,7 +287,7 @@ func (b *Bridge) ImportAll() error {
func (b *Bridge) Import(id string) error {
importer := b.getImporter()
if importer == nil {
return ErrImportNorSupported
return ErrImportNotSupported
}

err := b.ensureConfig()
Expand All @@ -304,7 +306,7 @@ func (b *Bridge) Import(id string) error {
func (b *Bridge) ExportAll() error {
exporter := b.getExporter()
if exporter == nil {
return ErrExportNorSupported
return ErrExportNotSupported
}

err := b.ensureConfig()
Expand All @@ -323,7 +325,7 @@ func (b *Bridge) ExportAll() error {
func (b *Bridge) Export(id string) error {
exporter := b.getExporter()
if exporter == nil {
return ErrExportNorSupported
return ErrExportNotSupported
}

err := b.ensureConfig()
Expand Down
Loading