feat: add random time jitter to the day
This commit is contained in:
@@ -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
|
||||
|
||||
3
main.go
3
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()
|
||||
|
||||
Reference in New Issue
Block a user