Re: [RFC] Two conceptually distinct commit commands

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Theodore Tso
Date: Monday, December 4, 2006 - 8:51 pm

On Mon, Dec 04, 2006 at 11:08:22AM -0800, Carl Worth wrote:

I think this is a very interesting proposal, although I think I
disagree with the last part:

      Any [rename or] removal of a tracked file will be detected and
      committed automatically.

If adds aren't going done automatically (because otherwise you have
problems with foo.c~ accidentally getting checked it), then it's
non-symmetric to expect that deletes will also happen automatically.
It's relatively rare that files are removed or renamed, and sometimes
files accidentally disappear.  

So in the case where there are no pathnames given to "git
commit-working-tree-content", I would argue that it does not do any
implicit "git add" on new files NOR any implicit "git rm" on missing
files unless the user actually specifies an --implicit-add or
--implicit-delete option, respectively.  If users want to make
--implicit-add and/or --implicit-delete the default, that could be a
configuration option, but I don't think it should be a default.


A second issue which you left unspecified is what should
commit-working-tree-content do if the index != HEAD.  In particular,
in this case:

edit foo.c
git update-index
edit foo.c
git commit-working-tree-content foo.c

What should happen to foo.c in the index?  Should it be stay the same?
Should the contents be replaced with version of foo.c that has just
been commited?  The latter seems to make sense, but runs the risk of
losing the data (what was in the index).  The former has the downside
that the index might have a version of foo.c which is older than what
has been just commited, which could be confusing.  Or should git
commit-working-tree abort with an error message if index != HEAD?

						- Ted
-
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:
[RFC] Two conceptually distinct commit commands, Carl Worth, (Mon Dec 4, 12:08 pm)
Re: [RFC] Two conceptually distinct commit commands, Carl Worth, (Mon Dec 4, 1:10 pm)
Re: [RFC] Two conceptually distinct commit commands , Horst H. von Brand, (Mon Dec 4, 5:52 pm)
Re: [RFC] Two conceptually distinct commit commands , Horst H. von Brand, (Mon Dec 4, 7:14 pm)
Re: [RFC] Two conceptually distinct commit commands, Theodore Tso, (Mon Dec 4, 8:51 pm)
Re: [RFC] Two conceptually distinct commit commands, Junio C Hamano, (Mon Dec 4, 11:33 pm)
Re: [RFC] Two conceptually distinct commit commands, Carl Worth, (Mon Dec 4, 11:38 pm)
Re: [RFC] Two conceptually distinct commit commands, Junio C Hamano, (Tue Dec 5, 6:13 pm)
Re: [RFC] Two conceptually distinct commit commands, Carl Worth, (Tue Dec 5, 9:53 pm)
Commit order in git.git, was Re: [RFC] Two conceptually di ..., Johannes Schindelin, (Wed Dec 6, 2:54 am)
Re: [RFC] Two conceptually distinct commit commands, Carl Worth, (Wed Dec 6, 9:14 am)