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

Re: [PATCH] stash: disable renames when calling git-diff

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2016, 20:36 UTC
Message-ID
<xmqqtwagztfz.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20161206202521.zxgxqsetgqejsyl3@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> Here it is in patch form. Perhaps I am missing some subtle case that
> diff-index would not handle, but it does pass the test suite. And
> looking over the original thread, I don't see any particular reason to
> prefer git-diff.

Ah, our mails crossed ;-) I am reasonably sure that "diff HEAD" and "diff-index HEAD" would behave identically.

Show 9 quoted lines
> @@ -115,7 +115,7 @@ create_stash () {
>  			git read-tree --index-output="$TMPindex" -m $i_tree &&
>  			GIT_INDEX_FILE="$TMPindex" &&
>  			export GIT_INDEX_FILE &&
> -			git diff --name-only -z HEAD -- >"$TMP-stagenames" &&
> +			git diff-index --name-only -z HEAD -- >"$TMP-stagenames" &&
>  			git update-index -z --add --remove --stdin <"$TMP-stagenames" &&
>  			git write-tree &&
>  			rm -f "$TMPindex"
Will queue this one instead.  Thanks.
Previous: Jeff King
Message 13 of 13 in “Bug: stash staged file move loses original file deletion”
  1. Matthew PateyDec 5, 2016
  2. Jeff KingDec 6, 2016
  3. Jeff KingDec 6, 2016
  4. stash: disable renames when calling git-diffJeff King, Dec 6, 2016
  5. Junio C HamanoDec 6, 2016
  6. Jeff KingDec 6, 2016
  7. Junio C HamanoDec 6, 2016
  8. Jeff KingDec 6, 2016
  9. Junio C HamanoDec 6, 2016
  10. Jeff KingDec 6, 2016
  11. Junio C HamanoDec 6, 2016
  12. Jeff KingDec 6, 2016
  13. Junio C HamanoDec 6, 2016

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.