{"thread":{"id":"59216","subject":"Doubt about skipped commits","startedAt":"2023-02-09T10:04:05Z","lastAt":"2023-02-09T11:50:40Z","messageCount":3,"participants":["Vinayak Dev","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"471843","messageId":"CADE8Narm5asbx_bdgT=Q_e1CiHUQqFSo3F2cWrataqq3O9YuKQ@mail.gmail.com","threadId":"59216","inReplyTo":null,"subject":"Doubt about skipped commits","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-02-09T10:03:48Z","receivedAt":"2023-02-09T10:04:05Z","isPatch":false,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"Hello everyone!\nI am a new git contributor, and was reading through the source code.\nI want to implement a small check that prevents an interactive rebase\nfrom proceeding with a fixup in case the last commit did not apply\ncleanly, in which case the fixup could amend the wrong commit.\n\nI am doubtful about how to check for missing/skipped commits in\nrebase-interactive.c .\nCould anyone provide guidance?\n\nThanks a lot!\nVinayak\n"},{"id":"471846","messageId":"230209.86cz6jxhat.gmgdl@evledraar.gmail.com","threadId":"59216","inReplyTo":"CADE8Narm5asbx_bdgT=Q_e1CiHUQqFSo3F2cWrataqq3O9YuKQ@mail.gmail.com","subject":"Re: Doubt about skipped commits","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2023-02-09T10:21:37Z","receivedAt":"2023-02-09T10:30:09Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Feb 09 2023, Vinayak Dev wrote:\n\n> Hello everyone!\n> I am a new git contributor, and was reading through the source code.\n> I want to implement a small check that prevents an interactive rebase\n> from proceeding with a fixup in case the last commit did not apply\n> cleanly, in which case the fixup could amend the wrong commit.\n\nHi, and welcome!\n\n> I am doubtful about how to check for missing/skipped commits in\n> rebase-interactive.c .\n> Could anyone provide guidance?\n\nI think it's probably best for this sort of thing to start with a test\ncase you think is doing the wrong thing, i.e. can you skim the\nt/*rebase*.sh tests we have, and see if you could amend one to produce a\ntest case that fails now, but which you expect to pass if you were to\nimplement this.\n\nI'm asking because if you mean that you have e.g.:\n\n\tpick B\n\tpick A\n\tfixup D\n\tpick C\n\nAnd we apply B, but then have a conflict with A, and drop you into the\nshell, you need to fix that etc. (maybe extensively), and you then want\n\"D\" to categorically fail to apply...\n\n...then that's something that a lot of people definitely rely on working\nthe way it does now.\n\nIn general just because your commit failed to apply cleanly it doesn't\nhave anything per-se to do with whether you want to fix up a later\ncommit into that failed-to-apply commit.\n\nE.g. consider a case where \"D\" is a typo fix for some documentation\npresnet in \"A\", but the reason we failed to apply \"A\" is because of a\nconflict in code that A and B both modify, but which is far removed from\nthe doc change.\n\nAnd even *if* it's all to the same few lines of code it's not obvious\nthat we don't want the fix-up still, we just want to resolve the\nconflict and move on.\n\nE.g. I might add a param to a function, and typo the parm name, and \"D\"\nis the fix-up for that typo, but \"B\" added another parameter, I still\nwant to churn ahead and apply this all in that order, conflicts and all.\n\nWhich is not to say that I don't think this *could* be useful,\ne.g. could we be smart enough to say \"hey, this would apply, but not\nanymore because this other thing got re-arranged\"?\n\nOr maybe you're talking about something else entirely.\n\nBut in any case, coming up with some testcase or demo for what you think\nis the wrong thing might save you some grief, in case someone annoying\nlike myself comes along and says \"actually that's intentional, and a lot\nof people rely on it\" :)\n"},{"id":"471849","messageId":"CADE8NapLKs4RsKMyCXxQh3PZXpUMk9E_ajDu2hPiq-fNiTP75w@mail.gmail.com","threadId":"59216","inReplyTo":"230209.86cz6jxhat.gmgdl@evledraar.gmail.com","subject":"Re: Doubt about skipped commits","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-02-09T11:23:35Z","receivedAt":"2023-02-09T11:50:40Z","isPatch":false,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"> I'm asking because if you mean that you have e.g.:\n>\n>         pick B\n>         pick A\n>         fixup D\n>         pick C\n>\n> And we apply B, but then have a conflict with A, and drop you into the\n> shell, you need to fix that etc. (maybe extensively), and you then want\n> \"D\" to categorically fail to apply...\n>\n> ...then that's something that a lot of people definitely rely on working\n> the way it does now.\n\nThanks for replying!\nIt does indeed look like the situation is intentional.\nI was actually looking for a microprojet for GSoC, and found this\nissue on GitGitGadget's git fork.\n\nI think I might need more scrutiny of the source-code to find a\nmicroproject, as most of the open issues seem to be already associated\nwith a PR.\n\nP.S. If you have any suggestions, I would be very grateful!\n\n\nThanks a lot!\nVinayak Dev\n"}]}