git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] git-add update with all-0 object
@ 2006-11-30 22:08 Daniel Barkalow
  2006-11-30 22:32 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Daniel Barkalow @ 2006-11-30 22:08 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

One thing that I think is non-intuitive to a lot of users (either novice 
or who just don't do it much) is that it matters where in the process you 
do "git add <path>" if you're also changing the file. Even if you 
understand the index, you may not realize (or may not have internalized 
the fact) that what git-add does is update the index with what's there 
now.

I think the more obvious behavior is to have it record the fact that you 
want to have the path tracked, but require one of the usual updating 
mechanisms to get a particular content into the index.

This should be pretty simple to implement: use --cacheinfo 0 0 $path 
instead of --add -- $path, and teach programs that look at the objects 
recorded in the index (rather than just hashes or other info) about all-0 
hashes meaning "but no content there". write-tree would probably just 
skip the entry (and then you could add a file, but still produce commits 
without it until you actually do either an update-index explicitly or one 
of the commit option sets that updates it); diff would treat it as empty; 
checkout would ignore it.

	-Daniel

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

end of thread, other threads:[~2006-12-02  8:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-30 22:08 [RFC] git-add update with all-0 object Daniel Barkalow
2006-11-30 22:32 ` Johannes Schindelin
2006-11-30 22:34 ` Nicolas Pitre
2006-11-30 22:41   ` Jakub Narebski
2006-11-30 22:49     ` Nicolas Pitre
2006-11-30 22:46 ` Linus Torvalds
2006-12-01  0:12   ` Daniel Barkalow
2006-12-01  4:57     ` Theodore Tso
2006-12-01  6:20       ` Junio C Hamano
2006-12-02  8:55         ` Jakub Narebski
2006-12-01  7:10       ` Linus Torvalds
2006-12-01  8:10       ` Daniel Barkalow
2006-12-01  9:37         ` Andy Parkins
2006-12-02  8:35           ` Jakub Narebski
2006-12-02  8:26         ` 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).