From: Karthik Nayak Date: Tue, 10 Mar 2026 17:15:31 GMT Subject: Re: [PATCH v2] advice: add stashBeforeCheckout advice for dirty branch switches Message-ID: In-Reply-To: Arsh Srivastava writes: > Subject: Re: [GSOC] advice: add stashBeforeCheckout advice for dirty > branch switches > > Patrick Steinhardt 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]