* Show skipped commit message after rebase conflict?
@ 2025-07-24 14:43 Cameron Steffen
2025-07-24 22:03 ` Junio C Hamano
0 siblings, 1 reply; 11+ messages in thread
From: Cameron Steffen @ 2025-07-24 14:43 UTC (permalink / raw)
To: git
Hello Git Community!
Sometimes I run into a conflict in a rebase and I end up resolving the
conflict by removing all the changes. Then when I run `git rebase
--continue`, the current commit is skipped and the rebase continues
normally. Would it be possible to emit a message showing that the
commit was skipped in this case? It isn't very obvious to me in my
workflow that that is what occurred.
Thanks,
Cameron Steffen
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-24 14:43 Show skipped commit message after rebase conflict? Cameron Steffen
@ 2025-07-24 22:03 ` Junio C Hamano
2025-07-25 14:02 ` Phillip Wood
0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2025-07-24 22:03 UTC (permalink / raw)
To: Cameron Steffen
Cc: git, Phillip Wood, Johannes Schindelin, Kristoffer Haugsbakk
Cameron Steffen <cam.steffen94@gmail.com> writes:
> Sometimes I run into a conflict in a rebase and I end up resolving the
> conflict by removing all the changes. Then when I run `git rebase
> --continue`, the current commit is skipped and the rebase continues
> normally. Would it be possible to emit a message showing that the
> commit was skipped in this case? It isn't very obvious to me in my
> workflow that that is what occurred.
I do not know what level of verbosity is needed to grab attention by
the end user, but something like this might be a good starting
point?
Totally untested, and there may be implications (like, control
passes this point in different situations where the messages is not
warranted).
I'll pick a few people from
git shortlog --since=2.years --no-merges sequencer.c
based on their contribution to the file (not counting the internal
implementation changes) and Cc them to see if they have ideas.
Thanks.
sequencer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git c/sequencer.c w/sequencer.c
index 67e4310edc..677d6105dd 100644
--- c/sequencer.c
+++ w/sequencer.c
@@ -5369,6 +5369,8 @@ static int commit_staged_changes(struct repository *r,
goto out;
}
+ warning(_("omitting a step that has become empty"));
+
if (!final_fixup) {
ret = 0;
goto out;
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: Show skipped commit message after rebase conflict?
2025-07-24 22:03 ` Junio C Hamano
@ 2025-07-25 14:02 ` Phillip Wood
2025-07-25 14:14 ` Cameron Steffen
2025-07-25 15:24 ` Junio C Hamano
0 siblings, 2 replies; 11+ messages in thread
From: Phillip Wood @ 2025-07-25 14:02 UTC (permalink / raw)
To: Junio C Hamano, Cameron Steffen
Cc: git, Phillip Wood, Johannes Schindelin, Kristoffer Haugsbakk
On 24/07/2025 23:03, Junio C Hamano wrote:
> Cameron Steffen <cam.steffen94@gmail.com> writes:
>
>> Sometimes I run into a conflict in a rebase and I end up resolving the
>> conflict by removing all the changes. Then when I run `git rebase
>> --continue`, the current commit is skipped and the rebase continues
>> normally. Would it be possible to emit a message showing that the
>> commit was skipped in this case? It isn't very obvious to me in my
>> workflow that that is what occurred.
>
> I do not know what level of verbosity is needed to grab attention by
> the end user, but something like this might be a good starting
> point?
>
> Totally untested, and there may be implications (like, control
> passes this point in different situations where the messages is not
> warranted).
I haven't tested it but I suspect this prints the warning when
continuing after a "break" command or a failed "exec" command. That is
probably a good place to issue such a message but we'd want to check
whether rebase_path_message() exists before printing the message. I
think we could also read REBASE_HEAD to find out which commit we're
skipping if we wanted to make the message a bit more informative.
It would mean that "rebase --skip" also prints this warning but I think
that is sensible if we're doing it for "rebase --continue" after
removing all the uncommitted changes from the worktree.
Thanks
Phillip
> I'll pick a few people from
>
> git shortlog --since=2.years --no-merges sequencer.c
>
> based on their contribution to the file (not counting the internal
> implementation changes) and Cc them to see if they have ideas.
>
> Thanks.
>
> sequencer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git c/sequencer.c w/sequencer.c
> index 67e4310edc..677d6105dd 100644
> --- c/sequencer.c
> +++ w/sequencer.c
> @@ -5369,6 +5369,8 @@ static int commit_staged_changes(struct repository *r,
> goto out;
> }
>
> + warning(_("omitting a step that has become empty"));
> +
> if (!final_fixup) {
> ret = 0;
> goto out;
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Show skipped commit message after rebase conflict?
2025-07-25 14:02 ` Phillip Wood
@ 2025-07-25 14:14 ` Cameron Steffen
2025-07-25 14:40 ` Junio C Hamano
2025-07-25 15:24 ` Junio C Hamano
1 sibling, 1 reply; 11+ messages in thread
From: Cameron Steffen @ 2025-07-25 14:14 UTC (permalink / raw)
To: phillip.wood
Cc: Junio C Hamano, git, Johannes Schindelin, Kristoffer Haugsbakk
There is already a message that prints in the case where a commit is
automatically skipped if the changes are already applied.
> warning: skipped previously applied commit <hash>
Potentially we could use the very same message.
On Fri, Jul 25, 2025 at 9:02 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> On 24/07/2025 23:03, Junio C Hamano wrote:
> > Cameron Steffen <cam.steffen94@gmail.com> writes:
> >
> >> Sometimes I run into a conflict in a rebase and I end up resolving the
> >> conflict by removing all the changes. Then when I run `git rebase
> >> --continue`, the current commit is skipped and the rebase continues
> >> normally. Would it be possible to emit a message showing that the
> >> commit was skipped in this case? It isn't very obvious to me in my
> >> workflow that that is what occurred.
> >
> > I do not know what level of verbosity is needed to grab attention by
> > the end user, but something like this might be a good starting
> > point?
> >
> > Totally untested, and there may be implications (like, control
> > passes this point in different situations where the messages is not
> > warranted).
>
> I haven't tested it but I suspect this prints the warning when
> continuing after a "break" command or a failed "exec" command. That is
> probably a good place to issue such a message but we'd want to check
> whether rebase_path_message() exists before printing the message. I
> think we could also read REBASE_HEAD to find out which commit we're
> skipping if we wanted to make the message a bit more informative.
>
> It would mean that "rebase --skip" also prints this warning but I think
> that is sensible if we're doing it for "rebase --continue" after
> removing all the uncommitted changes from the worktree.
>
> Thanks
>
> Phillip
>
> > I'll pick a few people from
> >
> > git shortlog --since=2.years --no-merges sequencer.c
> >
> > based on their contribution to the file (not counting the internal
> > implementation changes) and Cc them to see if they have ideas.
> >
> > Thanks.
> >
> > sequencer.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git c/sequencer.c w/sequencer.c
> > index 67e4310edc..677d6105dd 100644
> > --- c/sequencer.c
> > +++ w/sequencer.c
> > @@ -5369,6 +5369,8 @@ static int commit_staged_changes(struct repository *r,
> > goto out;
> > }
> >
> > + warning(_("omitting a step that has become empty"));
> > +
> > if (!final_fixup) {
> > ret = 0;
> > goto out;
> >
>
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Show skipped commit message after rebase conflict?
2025-07-25 14:14 ` Cameron Steffen
@ 2025-07-25 14:40 ` Junio C Hamano
2025-07-25 15:20 ` Cameron Steffen
0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2025-07-25 14:40 UTC (permalink / raw)
To: Cameron Steffen
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk
Cameron Steffen <cam.steffen94@gmail.com> writes:
> There is already a message that prints in the case where a commit is
> automatically skipped if the changes are already applied.
>
>> warning: skipped previously applied commit <hash>
>
> Potentially we could use the very same message.
Yes, that sounds like going in the right direction.
But only if we can positively tell the reason why there is no change
relative to the parent commit _is_ because the commit we are
currently picking has already been applied, that is.
I am not sure how you determine that, especially after giving
control back the end user upon conflict.
Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-25 14:40 ` Junio C Hamano
@ 2025-07-25 15:20 ` Cameron Steffen
2025-07-26 0:04 ` Junio C Hamano
2025-07-26 7:00 ` Johannes Sixt
0 siblings, 2 replies; 11+ messages in thread
From: Cameron Steffen @ 2025-07-25 15:20 UTC (permalink / raw)
To: Junio C Hamano
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk
> But only if we can positively tell the reason why there is no change
relative to the parent commit _is_ because the commit we are
currently picking has already been applied, that is.
I thought we merely would need to see that there are no staged changes
to be committed, and there is a currently-picking commit that will now
be skipped? I don't need to know whether the commit was already
applied. I just want to know that the commit in the rebase plan is not
being committed.
On Fri, Jul 25, 2025 at 9:40 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Cameron Steffen <cam.steffen94@gmail.com> writes:
>
> > There is already a message that prints in the case where a commit is
> > automatically skipped if the changes are already applied.
> >
> >> warning: skipped previously applied commit <hash>
> >
> > Potentially we could use the very same message.
>
> Yes, that sounds like going in the right direction.
>
> But only if we can positively tell the reason why there is no change
> relative to the parent commit _is_ because the commit we are
> currently picking has already been applied, that is.
>
> I am not sure how you determine that, especially after giving
> control back the end user upon conflict.
>
> Thanks.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-25 15:20 ` Cameron Steffen
@ 2025-07-26 0:04 ` Junio C Hamano
2025-07-26 2:40 ` Cameron Steffen
2025-07-26 7:00 ` Johannes Sixt
1 sibling, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2025-07-26 0:04 UTC (permalink / raw)
To: Cameron Steffen
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk
Cameron Steffen <cam.steffen94@gmail.com> writes:
>> But only if we can positively tell the reason why there is no change
> relative to the parent commit _is_ because the commit we are
> currently picking has already been applied, that is.
>
> I thought we merely would need to see that there are no staged changes
> to be committed, and there is a currently-picking commit that will now
> be skipped? I don't need to know whether the commit was already
> applied. I just want to know that the commit in the rebase plan is not
> being committed.
Then your earlier idea to reuse the same message
>> warning: skipped previously applied commit <hash>
>
> Potentially we could use the very same message.
would not work, would it?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-26 0:04 ` Junio C Hamano
@ 2025-07-26 2:40 ` Cameron Steffen
0 siblings, 0 replies; 11+ messages in thread
From: Cameron Steffen @ 2025-07-26 2:40 UTC (permalink / raw)
To: Junio C Hamano
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk
I see what you mean now. I guess I did not consider the meaning of
that message very closely.
On Fri, Jul 25, 2025 at 7:04 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Cameron Steffen <cam.steffen94@gmail.com> writes:
>
> >> But only if we can positively tell the reason why there is no change
> > relative to the parent commit _is_ because the commit we are
> > currently picking has already been applied, that is.
> >
> > I thought we merely would need to see that there are no staged changes
> > to be committed, and there is a currently-picking commit that will now
> > be skipped? I don't need to know whether the commit was already
> > applied. I just want to know that the commit in the rebase plan is not
> > being committed.
>
> Then your earlier idea to reuse the same message
>
> >> warning: skipped previously applied commit <hash>
> >
> > Potentially we could use the very same message.
>
> would not work, would it?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-25 15:20 ` Cameron Steffen
2025-07-26 0:04 ` Junio C Hamano
@ 2025-07-26 7:00 ` Johannes Sixt
2025-07-26 15:00 ` Cameron Steffen
1 sibling, 1 reply; 11+ messages in thread
From: Johannes Sixt @ 2025-07-26 7:00 UTC (permalink / raw)
To: Cameron Steffen
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk,
Junio C Hamano
Am 25.07.25 um 17:20 schrieb Cameron Steffen:
>> But only if we can positively tell the reason why there is no change
>> relative to the parent commit _is_ because the commit we are
>> currently picking has already been applied, that is.
>
> I thought we merely would need to see that there are no staged changes
> to be committed, and there is a currently-picking commit that will now
> be skipped? I don't need to know whether the commit was already
> applied. I just want to know that the commit in the rebase plan is not
> being committed.
How would rebase know what I did while I had control? I could have fixed
the conflicts and committed manually. I could have reset to a different
commit. I could have split the change into two commits. I could have
removed the changes. I could have made additional changes. Possibilities
are unlimited. Saying something like "commit 123abc is now empty" or "is
skipped" would be incorrect most of the time in my workflow.
-- Hannes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-26 7:00 ` Johannes Sixt
@ 2025-07-26 15:00 ` Cameron Steffen
0 siblings, 0 replies; 11+ messages in thread
From: Cameron Steffen @ 2025-07-26 15:00 UTC (permalink / raw)
To: Johannes Sixt
Cc: phillip.wood, git, Johannes Schindelin, Kristoffer Haugsbakk,
Junio C Hamano
> I could have fixed the conflicts and committed manually.
I believe we can detect any case where you ran `git commit`. I just
know that when you run git commit in that case the commit message is
_not_ auto populated from the pending commit. So git seems to be aware
if you did any commit that "replaces" the pending commit. So I think
that addresses most of the cases you mentioned. As long as the first
`git commit` after pausing from conflicts is non-empty, we can say the
pending commit is not "skipped".
> I could have reset to a different commit.
I think it would be okay to emit the message if you hard reset and continue.
On Sat, Jul 26, 2025 at 2:00 AM Johannes Sixt <j6t@kdbg.org> wrote:
>
> Am 25.07.25 um 17:20 schrieb Cameron Steffen:
> >> But only if we can positively tell the reason why there is no change
> >> relative to the parent commit _is_ because the commit we are
> >> currently picking has already been applied, that is.
> >
> > I thought we merely would need to see that there are no staged changes
> > to be committed, and there is a currently-picking commit that will now
> > be skipped? I don't need to know whether the commit was already
> > applied. I just want to know that the commit in the rebase plan is not
> > being committed.
>
> How would rebase know what I did while I had control? I could have fixed
> the conflicts and committed manually. I could have reset to a different
> commit. I could have split the change into two commits. I could have
> removed the changes. I could have made additional changes. Possibilities
> are unlimited. Saying something like "commit 123abc is now empty" or "is
> skipped" would be incorrect most of the time in my workflow.
>
> -- Hannes
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Show skipped commit message after rebase conflict?
2025-07-25 14:02 ` Phillip Wood
2025-07-25 14:14 ` Cameron Steffen
@ 2025-07-25 15:24 ` Junio C Hamano
1 sibling, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2025-07-25 15:24 UTC (permalink / raw)
To: Phillip Wood
Cc: Cameron Steffen, git, Phillip Wood, Johannes Schindelin,
Kristoffer Haugsbakk
Phillip Wood <phillip.wood123@gmail.com> writes:
> probably a good place to issue such a message but we'd want to check
> whether rebase_path_message() exists before printing the message. I
Ah, such a test intuitively feels correct. We are not creating a
commit, yet, we have message from the iteration being polished to
use when we do create one, which is about to be lost. The user
deserves to be notified of the lossage.
> think we could also read REBASE_HEAD to find out which commit we're
> skipping if we wanted to make the message a bit more informative.
>
> It would mean that "rebase --skip" also prints this warning but I
> think that is sensible if we're doing it for "rebase --continue" after
> removing all the uncommitted changes from the worktree.
Would --skip even pass this spot in the code by calling
commit_staged_changes()?
I am not intimately familiar with the way how the sequencer code is
organized, and am navigating largely by guesses on names of
functions and variables (iow, I didn't check).
Thanks.
>
> Thanks
>
> Phillip
>
>> I'll pick a few people from
>> git shortlog --since=2.years --no-merges sequencer.c
>> based on their contribution to the file (not counting the internal
>> implementation changes) and Cc them to see if they have ideas.
>> Thanks.
>> sequencer.c | 2 ++
>> 1 file changed, 2 insertions(+)
>> diff --git c/sequencer.c w/sequencer.c
>> index 67e4310edc..677d6105dd 100644
>> --- c/sequencer.c
>> +++ w/sequencer.c
>> @@ -5369,6 +5369,8 @@ static int commit_staged_changes(struct repository *r,
>> goto out;
>> }
>> + warning(_("omitting a step that has become empty"));
>> +
>> if (!final_fixup) {
>> ret = 0;
>> goto out;
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-07-26 15:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 14:43 Show skipped commit message after rebase conflict? Cameron Steffen
2025-07-24 22:03 ` Junio C Hamano
2025-07-25 14:02 ` Phillip Wood
2025-07-25 14:14 ` Cameron Steffen
2025-07-25 14:40 ` Junio C Hamano
2025-07-25 15:20 ` Cameron Steffen
2025-07-26 0:04 ` Junio C Hamano
2025-07-26 2:40 ` Cameron Steffen
2025-07-26 7:00 ` Johannes Sixt
2025-07-26 15:00 ` Cameron Steffen
2025-07-25 15:24 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).