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.