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

Re: git stash: status from current dir not top dir?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 14, 2011, 07:29 UTC
Message-ID
<7v1v2agnww.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4D7B358A.5010101@gmail.com>
Piotr Krukowiecki <piotr.krukowiecki@gmail.com> writes:
Show 18 quoted lines
> Subject: [PATCH] git stash: show status relative to current directory
>
> git status shows modified paths relative to current directory, so it's
> possible to copy&paste them directly, even if you're in a subdirectory.
>
> But "git stash apply" always shows status from root of git repository.
> This is misleading because you can't use the paths without modifications.
>
> This is caused by changing directory to root of repository at the
> beginning of git stash.
>
> This patch makes git stash show status relative to current directory.
> Instead of removing the "cd to toplevel", which would affect whole
> script and might have other side-effects, the fix is to change directory
> temporarily back to original dir just before displaying status.
>
> Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
> ---
Sensible. Thanks.
Don't we want to protect this output with some tests?
Previous: Piotr KrukowieckiNext: Piotr Krukowiecki
Message 4 of 8 in “git stash: status from current dir not top dir?”
  1. Piotr KrukowieckiMar 11, 2011
  2. Jeff KingMar 11, 2011
  3. Piotr KrukowieckiMar 12, 2011
  4. Junio C HamanoMar 14, 2011
  5. Piotr KrukowieckiMar 14, 2011
  6. Piotr KrukowieckiMar 17, 2011
  7. Junio C HamanoMar 17, 2011
  8. Piotr KrukowieckiMar 19, 2011

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.