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

Re: [PATCH] Added description for reversing git-update-index using --index-info

From
Junio C Hamano <junkio@cox.net>
Date
Nov 3, 2006, 02:40 UTC
Message-ID
<7vfyd1mew3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200611021113.01812.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 9 quoted lines
> +One particular use of --index-info is to reverse the effect of
> +"git-update-index frotz":
> +
> +------------
> +git ls-tree HEAD frotz | git update-index --index-info
> +------------
> +
> +This makes the index hold the file frotz from HEAD rather than from the
> +working copy.
Up to this point is good, but I am unhappy about the next example.
Show 6 quoted lines
> +------------
> +git ls-tree -r HEAD | git update-index --index-info
> +------------
> +
> +Will undo everything except "git add" from the index, as
> +"git-ls-tree -r" lists everything in the last commit.

While this is correct in the mechanical sense, it _sucks_ as an example, especially since you do not mention that the user would most likely need to do 'git update-index --refresh' afterwards to make the result useful.

Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 3 in “Added description for reversing git-update-index using --index-info”
  1. Added description for reversing git-update-index using --index-infoAndy Parkins, Nov 2, 2006
  2. Junio C HamanoNov 3, 2006
  3. Andy ParkinsNov 3, 2006

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.