Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added revision information to commit history. #3008

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions internal/runbits/commit/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type commitOutput struct {
Hash string `locale:"hash,[HEADING]Commit[/RESET]" json:"hash"`
Author string `locale:"author,[HEADING]Author[/RESET]" json:"author"`
Date string `locale:"date,[HEADING]Date[/RESET]" json:"date"`
Revision string `locale:"revision,[HEADING]Revision[/RESET]" json:"revision"`
Message string `locale:"message,[HEADING]Message[/RESET]" json:"message"`
PlainChanges []string `locale:"changes,[HEADING]Changes[/RESET]" json:"-"`
StructuredChanges []*requirementChange `opts:"hidePlain" json:"changes"`
Expand Down Expand Up @@ -80,6 +81,12 @@ func newCommitOutput(commit *mono_models.Commit, orgs []gmodel.Organization, isL
}
commitOutput.Date = dt.Format(time.RFC822)

dt, err = time.Parse(time.RFC3339, commit.AtTime.String())
if err != nil {
multilog.Error("Could not parse revision time: %v", err)
}
commitOutput.Revision = dt.Format(time.RFC822)

commitOutput.Message = locale.Tl("print_commit_no_message", "[DISABLED]Not provided.[/RESET]")
if commit.Message != "" {
commitOutput.Message = commit.Message
Expand Down
1 change: 1 addition & 0 deletions test/integration/history_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func (suite *HistoryIntegrationTestSuite) TestHistory_History() {
cp.Expect("Commit")
cp.Expect("Author")
cp.Expect("Date")
cp.Expect("Revision")
cp.Expect("Message")
cp.Expect("• requests (2.26.0 → 2.7.0)")
cp.Expect("• autopip (1.6.0 → Auto)")
Expand Down
Loading