Skip to content

Conversation

mstv
Copy link
Member

@mstv mstv commented Feb 17, 2025

Proposed changes

  • Create a GitRevision from information about autostash in .git/rebase-merge folder

Usecase:
Auto-stashed changes had been unreachable until the rebase was finished.
Displaying the "Autostash" revision enables workflows like:
If one wants to amend a former commit, then just edit that commit (context menu, a, e), cherry-pick the changes from the autostash and amend the commit.

image

Screenshots

Before

image

After

image

Test methodology

  • manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@mstv mstv self-assigned this Feb 17, 2025
Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never felt I wanted this. Any more motivation?
Probably OK regardless, not intrusive
But only minor comments

@pmiossec
Copy link
Member

Does that make sense and won't it be to difficult to display the branch as grey, like a stash (to not be confused by thinking it is a real branch)?

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any tests we could add to FormBrowseTests (there are some stash related tests in there)?

long now = DateTimeUtils.ToUnixTime(File.GetLastWriteTime(autoStashFileName));
GitRevision autoStashRevision = new(autoStashCommitId)
{
AuthorUnixTime = now,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Author = "git",?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is still the current user that makes the commit (autostash)
I rather have that blank:#12200 (comment)

@mstv mstv merged commit b490885 into gitextensions:master Mar 10, 2025
3 of 4 checks passed
@mstv mstv deleted the feature/autostash branch March 10, 2025 19:26
@mstv mstv added this to the v5.3 milestone Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants