Re: [PATCH v2] advice: add stashBeforeCheckout advice for dirty branch switches
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Mar 10, 2026, 17:15 UTC
- Message-ID
- <CAOLa=ZRRFWyvX7fSar8R1WYOQOz+mz_c_S9ZM7CDe9v7bbQeQQ@mail.gmail.com>
- In-Reply-To
- <CAOAgETOcivRUskCi4PCLnXzn1qGs9jx39JzgBA0jE=CirSkZJQ@mail.gmail.com>
Arsh Srivastava <arshsrivastava00@gmail.com> writes:
Show 23 quoted lines
> Subject: Re: [GSOC] advice: add stashBeforeCheckout advice for dirty > branch switches > > Patrick Steinhardt <ps@pks.im> writes: > >> It is used in "add.c", but not magically so. The function that you have >> introduced is the only site that uses the new advice, but the function >> is never called as far as I can see. So ultimately, the proposed change >> does not have any effect on the user-observable behaviour. > > Thank you for the correction and for the bottom-posting reminder. > > You are right. The function advise_on_checkout_dirty_files() is defined > but never called anywhere, so the patch has no user-observable effect. > I also looked into the existing behaviour more carefully and found that > unpack-trees.c already handles this case and prints a message telling > the user to commit or stash their changes before switching branches. > > So the patch as written is both incomplete and duplicates existing > behaviour. I will rework it in v3 to instead enhance the existing > message in unpack-trees.c to also mention 'git checkout -m' for users > who want to carry their local changes over to the new branch. >
I must say that the patch itself and the responses seem like they're generated with LLMs. Our guidelines for AI usage within the Git project are laid out in 'Documentation/SubmittingPatches'.
For GSoC specifically, we have laid out our expectations here [1]. Please go through them.
[1]: https://git.github.io/General-Application-Information/
[snip]