git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Importing from tarballs; add, rm, update-index?
@ 2007-01-12 13:41 Chris Riddoch
  2007-01-12 14:09 ` Horst H. von Brand
                   ` (3 more replies)
  0 siblings, 4 replies; 45+ messages in thread
From: Chris Riddoch @ 2007-01-12 13:41 UTC (permalink / raw)
  To: git

Hi, folks.

I've got a very, very old codebase I'm trying to wrap my head around.
It was apparently once tracked with RCS, but the ,v files are long
gone and all that remains are a series of tarballs on an FTP site
containing alpha, beta, and final releases of various versions of the
project.  There's a logical progression, but between each there are
new files, deleted files, and lots of changed files.  gitk will at
least help me make sense of the actual changes.  I've got part of a
shell script to automate this process.

Here's the problem.

I have tried to follow the debate on git add, rm, commit -a, etc.  But
I can't figure out how to simply say, take the full state of the
working directory, and make the index directly reflect that state.
Additions, removals, and differences alike.  One step, preferably.

My 2 cents on recent UI changes: I'm quite uncertain about the correct
(future 1.5.0) way of handling this kind of change to the index.  To
elaborate:

First, specifying extra files after 'git commit' bypasses the index.
If I remove foo.txt, and want to make a new commit reflecting only
that removal, would 'git commit foo.txt' do what I mean?  Apparently
so; I had to test it to find out, though.  It is a little surprising.

Using the 'add' command to really mean 'record the state of this file'
is confusing.  It makes me think of CVS's add (predictably), which
makes note of a new file and I think, "Well, I read on the list that
this is just another kind of 'adding content to the index,' right?"
Okay, I can accept that.  But using the 'git add .' idiom makes me
wonder whether the subdirectories are also supposed to be added, or
whether I need to worry about a recursive option.  Oddly, 'git pull .'
doesn't make me blink.  But then I need to remember to use 'git add'
to keep track of most changes in the index, new files and edits alike.
 I suspect a newbie coming from CVS might even use the word "re-add"
in their head to understand 'add'.

But this makes 'git rm' quite confusing.  After thinking I finally
understand 'git add', I think 'git rm' would mean "record the new
(nonexistent) state of this file in the index."  And then I'm
surprised to discover the file in my working directory actually
removed.  No, I guess I needed --cached.  Oops.  Wait a minute.
Cache?  The same cache mentioned in glossary.txt as being "Obsolete
for index?"

If rm is the opposite of add, shouldn't it work on the index by
default?  Hmm... "adding content to the index."  This file being
removed is new information that needs to be added to the index, like a
modification.  Removing a file is a kind of modification, after all.
I think this was the logic behind someone's suggestion of 'git add
--remove' which is quite ridiculous but follows somewhat naturally
from the idea that 'git add' is supposed to add information about
changes in the working directory to the index.

At this point, I think the behavior of 'git add' is as ridiculous as
that of 'git rm'.  Recent changes to 'git add' and 'git rm' make me
believe we're indecisive about whether we want people to think in
terms of the index or not.  I get the impression we're leaning towards
encouraging awareness of the index, because it's so helpful with
merges.

You know what I think we need?  A good command for updating the index.
 It could even be both porcelain and plumbing, if it had the right
error-checking.

I suggest calling it something like update-index.  ;)

Unless I'm completely misunderstanding git?

-- 
epistemological humility
  Chris Riddoch

^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2007-01-16 12:12 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-12 13:41 Importing from tarballs; add, rm, update-index? Chris Riddoch
2007-01-12 14:09 ` Horst H. von Brand
2007-01-12 14:39   ` Johannes Sixt
2007-01-12 15:39     ` Horst H. von Brand
2007-01-12 14:40 ` Morten Welinder
2007-01-12 18:47 ` Junio C Hamano
2007-01-12 19:11   ` Peter Baumann
2007-01-12 19:43     ` Junio C Hamano
2007-01-12 21:04       ` Peter Baumann
2007-01-13  0:48         ` Junio C Hamano
2007-01-13  9:33           ` Peter Baumann
2007-01-13 11:17             ` Johannes Schindelin
2007-01-13 16:19               ` Peter Baumann
2007-01-13 16:27                 ` Julian Phillips
2007-01-13 18:01             ` Junio C Hamano
2007-01-13 16:09           ` Carl Worth
2007-01-13 16:45             ` Brian Gernhardt
2007-01-13 16:48             ` Peter Baumann
2007-01-13 18:54             ` Nicolas Pitre
2007-01-13 19:32               ` Carl Worth
2007-01-13 20:25                 ` Junio C Hamano
2007-01-13 20:29                 ` Nicolas Pitre
2007-01-13  6:36       ` Brian Gernhardt
2007-01-13  9:36         ` Peter Baumann
2007-01-13 16:31           ` Brian Gernhardt
2007-01-13 18:15             ` Alan Chandler
2007-01-13 19:31               ` Brian Gernhardt
2007-01-13 20:34                 ` Shawn O. Pearce
2007-01-14 12:42                   ` Johannes Schindelin
2007-01-14 22:42                     ` Shawn O. Pearce
2007-01-14 23:49                       ` Horst H. von Brand
2007-01-15  1:06                       ` Junio C Hamano
2007-01-15  1:12                         ` Shawn O. Pearce
2007-01-15 22:46                           ` Daniel Barkalow
2007-01-16  0:34                             ` Horst H. von Brand
2007-01-16  3:35                               ` Daniel Barkalow
2007-01-16 12:12                                 ` Christian MICHON
2007-01-16  0:51                             ` Jakub Narebski
2007-01-13 21:41               ` Horst H. von Brand
2007-01-13 21:47                 ` Shawn O. Pearce
2007-01-13 22:04                   ` Horst H. von Brand
2007-01-12 19:34   ` Carl Worth
2007-01-12 23:28   ` Johannes Schindelin
2007-01-13  0:01     ` Junio C Hamano
2007-01-12 20:20 ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).