From d2483d83dd52365741f51eca106aa18c4e8d6420 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 16 Feb 2019 17:32:30 +0100 Subject: identity: I can compile again !! --- repository/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'repository/git.go') diff --git a/repository/git.go b/repository/git.go index c2f0da0a..10fddac3 100644 --- a/repository/git.go +++ b/repository/git.go @@ -29,7 +29,7 @@ type GitRepo struct { // Run the given git command with the given I/O reader/writers, returning an error if it fails. func (repo *GitRepo) runGitCommandWithIO(stdin io.Reader, stdout, stderr io.Writer, args ...string) error { - //fmt.Println("Running git", strings.Join(args, " ")) + // fmt.Printf("[%s] Running git %s\n", repo.Path, strings.Join(args, " ")) cmd := exec.Command("git", args...) cmd.Dir = repo.Path -- cgit From 71f9290fdae7551f3d3ada2179ece4084304d734 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 19 Feb 2019 00:19:27 +0100 Subject: identity: store the times properly --- repository/git.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'repository/git.go') diff --git a/repository/git.go b/repository/git.go index 10fddac3..836de8f0 100644 --- a/repository/git.go +++ b/repository/git.go @@ -20,6 +20,8 @@ const editClockFile = "/.git/git-bug/edit-clock" // ErrNotARepo is the error returned when the git repo root wan't be found var ErrNotARepo = errors.New("not a git repository") +var _ ClockedRepo = &GitRepo{} + // GitRepo represents an instance of a (local) git repository. type GitRepo struct { Path string @@ -440,11 +442,21 @@ func (repo *GitRepo) WriteClocks() error { return nil } +// CreateTime return the current value of the creation clock +func (repo *GitRepo) CreateTime() lamport.Time { + return repo.createClock.Time() +} + // CreateTimeIncrement increment the creation clock and return the new value. func (repo *GitRepo) CreateTimeIncrement() (lamport.Time, error) { return repo.createClock.Increment() } +// EditTime return the current value of the edit clock +func (repo *GitRepo) EditTime() lamport.Time { + return repo.editClock.Time() +} + // EditTimeIncrement increment the edit clock and return the new value. func (repo *GitRepo) EditTimeIncrement() (lamport.Time, error) { return repo.editClock.Increment() -- cgit From 839b241f0c1b8ee670be207688228e8ea71602b7 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 23 Feb 2019 13:02:36 +0100 Subject: git: fix RmConfigs --- repository/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'repository/git.go') diff --git a/repository/git.go b/repository/git.go index 836de8f0..c982f820 100644 --- a/repository/git.go +++ b/repository/git.go @@ -204,7 +204,7 @@ func (repo *GitRepo) ReadConfigs(keyPrefix string) (map[string]string, error) { // RmConfigs remove all key/value pair matching the key prefix func (repo *GitRepo) RmConfigs(keyPrefix string) error { - _, err := repo.runGitCommand("config", "--remove-section", keyPrefix) + _, err := repo.runGitCommand("config", "--unset-all", keyPrefix) return err } -- cgit