login
Header Space

 
 

Re: [Census] So who uses git?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nicolas Pitre <nico@...>
Cc: Linus Torvalds <torvalds@...>, <git@...>
Date: Wednesday, February 1, 2006 - 4:27 pm

Nicolas Pitre <nico@cam.org> writes:


I agree; it was tongue-in-cheek sort of suggestion ;-)


Good thinking.  I was not thinking about the case where you
explicitly list an untracked file to be added.


If I may correct what I said earlier, I now realize the
"automatic -a is dangerous" argument does not have anything to
do with merges.  If the user usually works with a dirty working
tree, is aware of the index, and takes advantage of the index as
the staging area for the next commit, your --no-auto would be
needed to help her workflow.  I in principle agree with the
first three items in the above summary, except that I think it
would make more sense to do that for all commits.

How about this:

 - "git commit --also fileA..." means: update index at listed
   paths (add/remove if necessary) and then commit the tree
   described in index (the current behaviour with explicit paths).

 - "git commit fileA..." means: create a temporary index from the
   current HEAD commit (or empty index if there is none), update
   it at listed paths (add/remove if necessary) and commit the
   resulting tree.  Also update the real index at the listed
   paths (add/remove if necessary).  In the original index file,
   the paths listed must be either empty or match exactly the
   HEAD commit -- otherwise we error out (Linus' suggestion).

 - "git commit" means: update index with all local changes and
   then commit the tree described in index (current "-a"
   behaviour).

 - In all cases, revert the index to the state before the
   command is run if we end up not making the commit (e.g. index
   unmerged, empty log message, pre-commit hook refusal).

Experienced git users would end up saying "--also" without
explicit paths to defeat the automatic -a behaviour all the
time, and while the flag --also makes perfect sense when used
with one or more paths, using it like this look awkward:

        $ edit some-file
        $ git update-index some-file
        $ git commit --also

It's just a flag name so we could make --no-auto synonym to --also.

A minor twist of the above to make it friendlier to the current
git users is to do this:

 - "git commit fileA...", "git commit -a", and "git commit" keep
   the existing semantics.

 - "git commit --only fileA..." does the new temporary index
   thing.

This has an advantage that existing use is not affected, and
another advantage is that internally it is more consistent ("git
commit" is a natural extension of "git commit fileA..." with
zero path).  But one possible downside is that you need to
explicitly say --only when you want cvs-like "commit".

Since we are discussing that the people find existing
interface to be unintuitive, being consistent with the current
usage may not count as a big advantage after all..

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [Census] So who uses git?, Junio C Hamano, (Wed Feb 1, 4:27 pm)
Re: [Census] So who uses git?, Joel Becker, (Wed Feb 1, 6:00 pm)
Re: [Census] So who uses git?, Linus Torvalds, (Wed Feb 1, 5:09 pm)
Re: [Census] So who uses git?, Junio C Hamano, (Wed Feb 1, 5:59 pm)
Re: [Census] So who uses git?, Daniel Barkalow, (Wed Feb 1, 6:57 pm)
Re: [Census] So who uses git?, Linus Torvalds, (Wed Feb 1, 6:35 pm)
Two ideas for improving git's user interface, Carl Worth, (Wed Feb 1, 7:33 pm)
Re: Two ideas for improving git's user interface, Carl Baldwin, (Thu Feb 2, 12:30 pm)
Re: Two ideas for improving git's user interface, Florian Weimer, (Thu Feb 2, 8:31 am)
Re: Two ideas for improving git's user interface, Linus Torvalds, (Wed Feb 1, 9:23 pm)
Re: Two ideas for improving git's user interface, Carl Worth, (Fri Feb 3, 8:20 pm)
Re: Two ideas for improving git's user interface, Linus Torvalds, (Fri Feb 3, 10:08 pm)
Re: Two ideas for improving git's user interface, Carl Worth, (Mon Feb 6, 7:42 pm)
Re: Two ideas for improving git's user interface, Linus Torvalds, (Wed Feb 1, 9:44 pm)
Re: Two ideas for improving git's user interface, Alan Chandler, (Sat Feb 4, 4:03 am)
Re: Two ideas for improving git's user interface, Junio C Hamano, (Sat Feb 4, 4:25 am)
Re: Two ideas for improving git's user interface, Alan Chandler, (Sat Feb 4, 5:30 am)
Re: [Census] So who uses git?, Nicolas Pitre, (Wed Feb 1, 6:25 pm)
Re: [Census] So who uses git?, Junio C Hamano, (Wed Feb 1, 6:50 pm)
Re: [Census] So who uses git?, Andreas Ericsson, (Thu Feb 2, 10:59 am)
Re: [Census] So who uses git?, Nicolas Pitre, (Wed Feb 1, 5:34 pm)
speck-geostationary