diff --git a/README.md b/README.md index 2425cde..11bd3f3 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ go build . ### TODOs - [x] Wipe 4 reflog entries corresponding to the interactive rebase -- [ ] Add jitter to amend timestamp +- [x] Add jitter to amend timestamp diff --git a/main.go b/main.go index 412bfb6..920c80a 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "bytes" "fmt" + "math/rand" "os/exec" "strings" "time" @@ -113,6 +114,8 @@ func (m Model) ChangeDate() { if err != nil { log.Fatalf("failed to parse new date: %v", err) } + timedelta := rand.Int63n(int64(time.Hour * 24)) + parsedDate = parsedDate.Add(time.Duration(timedelta)) dateString := parsedDate.String() rebaseRelativeToHead := m.list.Cursor() + 1 rebaseHash := m.commits[m.list.Cursor()].Hash.String()