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

Re: [PATCH v2 2/3] stash: Don't overwrite files that have gone from the index

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2010, 23:11 UTC
Message-ID
<7vpr1wtkyu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100418182805.GB29329@hashpling.org>
Charles Bailey <charles@hashpling.org> writes:
> To be complete, any work tree file which differs from HEAD needs to be
> saved, regardless of whether it still appears in the index or not.
Sounds quite sane.
> -			git add -u &&
> +			git diff --name-only -z HEAD | git update-index -z --add --remove --stdin &&

Paths that exist in HEAD but not in the index will be caught with this; what about paths that do not exist in HEAD but is in the index---they will be kept in the index so they are fine as well. Good.

Thanks.
Previous: Charles BaileyNext: Charles Bailey
Message 2 of 4 in “stash: Don't overwrite files that have gone from the index”
  1. 2/3 stash: Don't overwrite files that have gone from the indexCharles Bailey, Apr 18, 2010
  2. Junio C HamanoApr 18, 2010
  3. 3/3 Documentation: Describe other situations where -z affects git diffCharles Bailey, Apr 18, 2010
  4. Junio C HamanoApr 18, 2010

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.