* Doubt about skipped commits
@ 2023-02-09 10:03 Vinayak Dev
2023-02-09 10:21 ` Ævar Arnfjörð Bjarmason
0 siblings, 1 reply; 3+ messages in thread
From: Vinayak Dev @ 2023-02-09 10:03 UTC (permalink / raw)
To: git
Hello everyone!
I am a new git contributor, and was reading through the source code.
I want to implement a small check that prevents an interactive rebase
from proceeding with a fixup in case the last commit did not apply
cleanly, in which case the fixup could amend the wrong commit.
I am doubtful about how to check for missing/skipped commits in
rebase-interactive.c .
Could anyone provide guidance?
Thanks a lot!
Vinayak
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Doubt about skipped commits
2023-02-09 10:03 Doubt about skipped commits Vinayak Dev
@ 2023-02-09 10:21 ` Ævar Arnfjörð Bjarmason
2023-02-09 11:23 ` Vinayak Dev
0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2023-02-09 10:21 UTC (permalink / raw)
To: Vinayak Dev; +Cc: git
On Thu, Feb 09 2023, Vinayak Dev wrote:
> Hello everyone!
> I am a new git contributor, and was reading through the source code.
> I want to implement a small check that prevents an interactive rebase
> from proceeding with a fixup in case the last commit did not apply
> cleanly, in which case the fixup could amend the wrong commit.
Hi, and welcome!
> I am doubtful about how to check for missing/skipped commits in
> rebase-interactive.c .
> Could anyone provide guidance?
I think it's probably best for this sort of thing to start with a test
case you think is doing the wrong thing, i.e. can you skim the
t/*rebase*.sh tests we have, and see if you could amend one to produce a
test case that fails now, but which you expect to pass if you were to
implement this.
I'm asking because if you mean that you have e.g.:
pick B
pick A
fixup D
pick C
And we apply B, but then have a conflict with A, and drop you into the
shell, you need to fix that etc. (maybe extensively), and you then want
"D" to categorically fail to apply...
...then that's something that a lot of people definitely rely on working
the way it does now.
In general just because your commit failed to apply cleanly it doesn't
have anything per-se to do with whether you want to fix up a later
commit into that failed-to-apply commit.
E.g. consider a case where "D" is a typo fix for some documentation
presnet in "A", but the reason we failed to apply "A" is because of a
conflict in code that A and B both modify, but which is far removed from
the doc change.
And even *if* it's all to the same few lines of code it's not obvious
that we don't want the fix-up still, we just want to resolve the
conflict and move on.
E.g. I might add a param to a function, and typo the parm name, and "D"
is the fix-up for that typo, but "B" added another parameter, I still
want to churn ahead and apply this all in that order, conflicts and all.
Which is not to say that I don't think this *could* be useful,
e.g. could we be smart enough to say "hey, this would apply, but not
anymore because this other thing got re-arranged"?
Or maybe you're talking about something else entirely.
But in any case, coming up with some testcase or demo for what you think
is the wrong thing might save you some grief, in case someone annoying
like myself comes along and says "actually that's intentional, and a lot
of people rely on it" :)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Doubt about skipped commits
2023-02-09 10:21 ` Ævar Arnfjörð Bjarmason
@ 2023-02-09 11:23 ` Vinayak Dev
0 siblings, 0 replies; 3+ messages in thread
From: Vinayak Dev @ 2023-02-09 11:23 UTC (permalink / raw)
To: Ævar Arnfjörð Bjarmason; +Cc: git
> I'm asking because if you mean that you have e.g.:
>
> pick B
> pick A
> fixup D
> pick C
>
> And we apply B, but then have a conflict with A, and drop you into the
> shell, you need to fix that etc. (maybe extensively), and you then want
> "D" to categorically fail to apply...
>
> ...then that's something that a lot of people definitely rely on working
> the way it does now.
Thanks for replying!
It does indeed look like the situation is intentional.
I was actually looking for a microprojet for GSoC, and found this
issue on GitGitGadget's git fork.
I think I might need more scrutiny of the source-code to find a
microproject, as most of the open issues seem to be already associated
with a PR.
P.S. If you have any suggestions, I would be very grateful!
Thanks a lot!
Vinayak Dev
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-09 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-09 10:03 Doubt about skipped commits Vinayak Dev
2023-02-09 10:21 ` Ævar Arnfjörð Bjarmason
2023-02-09 11:23 ` Vinayak Dev
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).