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

Support git-revise through merge commits #137

Open
MartyLake opened this issue May 15, 2024 · 0 comments
Open

Support git-revise through merge commits #137

MartyLake opened this issue May 15, 2024 · 0 comments

Comments

@MartyLake
Copy link

Hello,

I realise that my message #131 (comment) would better be fit for its own issue ticket.

I work on multiple feature branches, and usually keep them all together via a merge commit at the top, named all-feats.
During the day, I pile up commits on the all-feats branch, and then regularly redistribute them to their own branches, using the --update-refs option when rebasing..

I wish I could do that using git-revise, since rebasing across merge commits is very slow using git.

Here are some reproduction steps:

reproduction steps

$ mkdir /tmp/test-git-revise
$ cd /tmp/test-git-revise/
$ git init
Initialized empty Git repository in /private/tmp/test-git-revise/.git/
$ echo "lorem ipsum" > README
$ git add README
$ git config user.email "[email protected]"
$ git config user.name "example"
$ git commit -m "first commit"
[master (root-commit) ddeb30d] first commit
 1 file changed, 1 insertion(+)
 create mode 100644 README
$ git checkout -b feat-a
Switched to a new branch 'feat-a'
$ echo "lorem ipsum with a typo" > a.txt
$ # Here I forgot to add the new file and commit, it happens a bit later
$ git checkout master
Switched to branch 'master'
$ git checkout -b feat-b
Switched to a new branch 'feat-b'
$ echo "lorem ipsum" > b.txt
$ git add b.txt
$ git commit -m "featb"
[feat-b d22a5ea] featb
 1 file changed, 1 insertion(+)
 create mode 100644 b.txt
$ git checkout feat-a
Switched to branch 'feat-a'
$ git add a.txt
$ git commit -m "feata"
[feat-a 2628ddc] feata
 1 file changed, 1 insertion(+)
 create mode 100644 a.txt
$ git checkout -b "all-feats"
Switched to a new branch 'all-feats'
$ git merge feat-b
Merge made by the 'ort' strategy.
 b.txt | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 b.txt
$ echo "explain historic typo" >> a.txt
$ git add a.txt
$ git commit --fixup=2628ddc991de547b666047ec39e2fe28148
[all-feats 99e6e3c] fixup! feata
 1 file changed, 1 insertion(+)
$ git log --graph --oneline
* 99e6e3c (HEAD -> all-feats) fixup! feata
*   7a8e7af Merge branch 'feat-b' into all-feats
|\
| * d22a5ea (feat-b) featb
* | 2628ddc (feat-a) feata
|/
* ddeb30d (master) first commit

actual

$ git revise -i master
invalid value: Commit 7a8e7af951094fd1badedd9f52f507b7924901d9 has 2 parents

expected

$ git revise -i master

# git-revise displays an edit-todo similar to the edit-todo of `git rebase -i master` here
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

No branches or pull requests

1 participant