-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Don't modify commits on rebase #1452
Comments
ooh that's a tricky one, seems annoying though. I will have a look (also open to PRs if you feel comfortable with that) |
What would you expect, the rebaser to be represented in the trailers, but added to the existing ones, to appear as "the committer" or just make no change? |
My instinct would be just to leave the commits as-is in the scenario I’m talking about.
I guess there are cases where you’re doing an interactive rebase and you might want something else, but I’d say those are more niche and people can manually add commit trailers if they want to in those situations.
|
This is the behaviour I am going to add, seem sensible? I'll do it as opt in then push a change to make it the default with a major bump RebasesIt might be preferable not to do this on rebase, you can disable this happening on rebase by running git mit-config mit rebase-behaviour no-change lets say we have two diverging branches echo "Lorem Ipsum" >> new-so-no-conflicts.md
git switch -c rebase-demo-branch
git switch -
git commit --all --message="Diverging commit" --quiet
git switch - Now you can rebase changes without adding any additional trailers git mit bt se
echo "Lorem Ipsum" >> README.md
git commit --all --message="Rebase behaviour
" --quiet
git show --pretty='format:author: [%an %ae] signed-by: [%GS]
---
%B' -q
Then if you rebase the commit stays the same git mit bt ae
git rebase --reset-author-date "-" ls .git
echo ----
cat .git/AUTO_MERGE
echo ----
cat .git/HEAD
echo ----
cat .git/ORIG_HEAD
echo ----
git show --pretty='format:author: [%an %ae] signed-by: [%GS]
---
%B' -q
The default setting is to modify the co-authored by. git mit-config mit rebase-behaviour add-to Now you can rebase changes without adding any additional trailers git mit bt se
git rebase --reset-author-date "-" git show --pretty='format:author: [%an %ae] signed-by: [%GS]
---
%B' -q
|
Perfect! 🙌🏻
|
This should be out now, not defaulted yet.
to turn it on |
Is your feature request related to a problem? Please describe.
I've noticed that if I'm working in a branch and I rebase from
main
, all the commits in the branch end up with the current set of configured co-authors on them. So the original co-author info in the branch is lost.Describe the solution you'd like
When doing a rebase, don't modify the co-author trailer on the rebased commits.
Describe alternatives you've considered
Live with it? :)
The text was updated successfully, but these errors were encountered: