Re: [PATCH 0/5] Advice on checkout dirty files
- From
Arsh Srivastava <arshsrivastava00@gmail.com>
- Date
- Mar 10, 2026, 10:42 UTC
- Message-ID
- <CAOAgETPnZww2vB1zz37nRNEJnmnDjwWyEPDHjRFuijin3memyg@mail.gmail.com>
- In-Reply-To
- <5f100fe0-d601-4ee3-adb9-a2458203d10d@gmail.com>
Thank you so much for the advice I will
> rebase my file’s pointer head
And just wanted to know what do you recommend should be my changed approach for me over this pr to make that function useful
On Tue, 10 Mar 2026 at 4:03 PM, Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 74 quoted lines
> > Hi Arsh > > On 10/03/2026 08:51, Arsh Srivastava via GitGitGadget wrote: > > This is my submission for microproject [GSOC] > > > > This patch adds a new advice type ADVICE_STASH_BEFORE_CHECKOUT to help users > > when they attempt to switch branches with local modifications that would be > > overwritten by the operation. > > If the intent is for the user to carry over the changes to the new > branch then recommending "git checkout -m" might be more convenient > rather than having to stash, checkout and unstash as three separate steps. > > Something seems to have gone awry with your branch as there are other > patches in this series. You should rebase your branch onto the upstream > master branch with > > git rebase --onto origin/master HEAD^ > > and then when you push it double check how many commits there are in the > summary of the pull request before submitting. > > Thanks > > Phillip > > > The new advice follows the same patterns established by existing advice > > functions such as advise_on_updating_sparse_paths(). When triggered, it > > lists the affected files and suggests using git stash push/pop to save and > > restore local changes. > > > > The advice can be silenced with: > > > > git config set advice.stashBeforeCheckout false > > > > Changes: > > > >> advice.h: add ADVICE_STASH_BEFORE_CHECKOUT enum value advice.c: add > >> "stashBeforeCheckout" to advice_setting[] and implement > >> advise_on_checkout_dirty_files() function > >> Documentation/config/advice.adoc: document the new advice key > > > > Signed-off-by: Arsh Srivastava arshsrivastava00@gmail.com > > > > Arsh Srivastava (1): > > advice: add stashBeforeCheckout advice for dirty branch switches > > > > Junio C Hamano (1): > > The 13th batch > > > > K Jayatheerth (1): > > repo: remove unnecessary variable shadow > > > > LorenzoPegorari (2): > > diff: handle ANSI escape codes in prefix when calculating diffstat > > width > > t4052: test for diffstat width when prefix contains ANSI escape codes > > > > Documentation/RelNotes/2.54.0.adoc | 14 +++++++++++++ > > Documentation/config/advice.adoc | 5 +++++ > > advice.c | 27 +++++++++++++++++++++++++ > > advice.h | 2 ++ > > builtin/repo.c | 1 - > > diff.c | 12 ++++------- > > t/t4052-stat-output.sh | 32 ++++++++++++++++++++++++++++++ > > 7 files changed, 84 insertions(+), 9 deletions(-) > > > > > > base-commit: 3fe08b8fd1f7731edabeab8138547ec88d6407de > > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2233%2FArsh123344423%2Fadvice_on_checkout_dirty_files-v1 > > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2233/Arsh123344423/advice_on_checkout_dirty_files-v1 > > Pull-Request: https://github.com/git/git/pull/2233 >