git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] advice: add stashBeforeCheckout advice for dirty branch switches

From
Arsh Srivastava <arshsrivastava00@gmail.com>
Date
Mar 10, 2026, 18:00 UTC
Message-ID
<CAOAgETPfXxjo-Ltw=4q7rG_AV4VpGzRCwLDBTvdxtbWbh22GYA@mail.gmail.com>
In-Reply-To
<CAOLa=ZRRFWyvX7fSar8R1WYOQOz+mz_c_S9ZM7CDe9v7bbQeQQ@mail.gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes
> Use of Ai in patches and messages
> Suggest the documentation for the same

After reading the document carefully again , I understood my mistakes and I promise to not repeat it again while submitting future PR and commits. I am deeply sorry for the mistakes I made and promise to never repeat them again including in submission of version 4 of my current PR

On Tue, 10 Mar 2026 at 22:45, Karthik Nayak <karthik.188@gmail.com> wrote:
Show 37 quoted lines
>
> Arsh Srivastava <arshsrivastava00@gmail.com> writes:
>
> > 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]
Previous: Karthik NayakNext: Arsh Srivastava
Message 56 of 62 in “Advice on checkout dirty files”
  1. 0/5 Advice on checkout dirty filesArsh Srivastava via GitGitGadget, Mar 10, 2026
  2. 1/5 diff: handle ANSI escape codes in prefix when calculating diffstat widthLorenzoPegorari via GitGitGadget, Mar 10, 2026
  3. 2/5 t4052: test for diffstat width when prefix contains ANSI escape codesLorenzoPegorari via GitGitGadget, Mar 10, 2026
  4. 3/5 repo: remove unnecessary variable shadowK Jayatheerth via GitGitGadget, Mar 10, 2026
  5. 4/5 The 13th batchJunio C Hamano via GitGitGadget, Mar 10, 2026
  6. 5/5 advice: add stashBeforeCheckout advice for dirty branch switchesArsh Srivastava via GitGitGadget, Mar 10, 2026
  7. Phillip WoodMar 10, 2026
  8. Arsh SrivastavaMar 10, 2026
  9. Arsh SrivastavaMar 10, 2026
  10. Junio C HamanoMar 10, 2026
  11. Arsh SrivastavaMar 10, 2026
  12. Junio C HamanoMar 10, 2026
  13. Arsh SrivastavaMar 10, 2026
  14. Arsh SrivastavaMar 10, 2026
  15. advice: add stashBeforeCheckout advice for dirty branch switchesArsh Srivastava via GitGitGadget, Mar 10, 2026
  16. Patrick SteinhardtMar 10, 2026
  17. Arsh SrivastavaMar 10, 2026
  18. Patrick SteinhardtMar 10, 2026
  19. 0/2 Advice on checkout dirty filesArsh Srivastava via GitGitGadget, Mar 10, 2026
  20. 1/2 advice: add stashBeforeCheckout advice for dirty branch switchesArsh Srivastava via GitGitGadget, Mar 10, 2026
  21. Arsh SrivastavaMar 10, 2026
  22. 2/2 advice: add stashBeforeCheckout advice for dirty branch switches [GSOC]Arsh Srivastava via GitGitGadget, Mar 10, 2026
  23. 0/5 Advice on checkout dirty filesArsh Srivastava via GitGitGadget, Mar 11, 2026
  24. 1/5 advice: add stashBeforeCheckout advice for dirty branch switchesArsh Srivastava via GitGitGadget, Mar 11, 2026
  25. 2/5 advice: add stashBeforeCheckout advice for dirty branch switches [GSOC]Arsh Srivastava via GitGitGadget, Mar 11, 2026
  26. 3/5 unpack-trees: suggesting 'git checkout -m <branch>' with its repercussionsArsh Srivastava via GitGitGadget, Mar 11, 2026
  27. 4/5 Updating tests and unpack-tress.c [GSOC]Arsh Srivastava via GitGitGadget, Mar 11, 2026
  28. 5/5 File updation [GSOC]Arsh Srivastava via GitGitGadget, Mar 11, 2026
  29. Junio C HamanoMar 11, 2026
  30. Arsh SrivastavaMar 11, 2026
  31. 0/3 Advice on checkout dirty filesArsh Srivastava via GitGitGadget, Mar 11, 2026
  32. 1/3 advice: add stashBeforeCheckout advice for dirty branch switchesArsh Srivastava via GitGitGadget, Mar 11, 2026
  33. 2/3 advice: add stashBeforeCheckout advice for dirty branch switches [GSOC]Arsh Srivastava via GitGitGadget, Mar 11, 2026
  34. 3/3 unpack-trees: suggesting 'git checkout -m <branch>' with its repercussionsArsh Srivastava via GitGitGadget, Mar 11, 2026
  35. Junio C HamanoMar 12, 2026
  36. Arsh SrivastavaMar 12, 2026
  37. unpack-trees: suggesting 'git checkout -m' with its repercussionsArsh Srivastava via GitGitGadget, Mar 12, 2026
  38. Junio C HamanoMar 12, 2026
  39. Arsh SrivastavaMar 12, 2026
  40. Junio C HamanoMar 12, 2026
  41. Arsh SrivastavaMar 12, 2026
  42. Junio C HamanoMar 12, 2026
  43. Arsh SrivastavaMar 12, 2026
  44. unpack-trees: suggest using 'git stash' when checkout failsArsh Srivastava via GitGitGadget, Mar 12, 2026
  45. Junio C HamanoMar 12, 2026
  46. Arsh SrivastavaMar 13, 2026
  47. Karthik NayakMar 13, 2026
  48. Arsh SrivastavaMar 13, 2026
  49. Junio C HamanoMar 13, 2026
  50. Arsh SrivastavaMar 13, 2026
  51. Arsh SrivastavaMar 13, 2026
  52. Karthik NayakMar 10, 2026
  53. Arsh SrivastavaMar 10, 2026
  54. Arsh SrivastavaMar 10, 2026
  55. Karthik NayakMar 10, 2026
  56. Arsh SrivastavaMar 10, 2026
  57. Arsh SrivastavaMar 10, 2026
  58. Junio C HamanoMar 10, 2026
  59. Karthik NayakMar 10, 2026
  60. Konstantin RyabitsevMar 14, 2026
  61. Arsh SrivastavaMar 10, 2026
  62. Arsh SrivastavaMar 10, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.