Re: Considering teaching plumbing to users harmful
- From
- J. Bruce Fields <bfields@fieldses.org>
- Date
- Jul 18, 2008, 14:35 UTC
- Message-ID
- <20080718143524.GD5288@fieldses.org>
- In-Reply-To
- <7vmykgfhtj.fsf@gitster.siamese.dyndns.org>
On Thu, Jul 17, 2008 at 12:10:00PM -0700, Junio C Hamano wrote:
Show 28 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > On Thu, 17 Jul 2008, Junio C Hamano wrote: > > > >> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > >> > >> >> Is there a way to commit the contents of a tarball without using > >> >> plumbing? I occasionally want to track an upstream that I know only > >> >> as a series of tarballs, so I do something like: > >> >> > >> >> cd repo/ > >> >> git checkout upstream > >> >> rm -rf * > >> >> tar -xzvf ../new-version.tar.gz > >> > > >> > How about "git add -u" and "git add ."? > >> > >> It would work only if new version never removes files. > > > > You made me doubt for a second there. But "git add -u" updates the index > > when a tracked files was deleted. So after "rm -rf *", "git add -u" would > > empty the index. > > I thought everybody would react to my message like so after sending it ;-) > What I failed to say was that the main uneasiness about the above command > sequence Bruce or anybody would have felt would be that "rm -fr *" step, > which in itself look scary and does not remove .frotz that came from older > version.
Yeah, good point, that's not very careful.
But actually it's "add -u" that I missed--I forgot it would take into account removed files as well. Thanks!
--b.