git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Carl Worth <cworth@cworth.org>
Cc: Nicolas Pitre <nico@cam.org>, Theodore Tso <tytso@mit.edu>,
	Andreas Ericsson <ae@op5.se>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <junkio@cox.net>,
	git@vger.kernel.org
Subject: Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".
Date: Thu, 30 Nov 2006 11:55:30 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0611301132350.3513@woody.osdl.org> (raw)
In-Reply-To: <87hcwgu5t1.wl%cworth@cworth.org>



On Thu, 30 Nov 2006, Carl Worth wrote:
> 
> If the "create file; git add; edit file; git commit" confusion isn't
> blisteringly obvious to the git maintainers then I think I have to
> give up here.
> 
> And this isn't just CVS-induced brain damage.

I'm sorry, but you are wrong.

It really _is_ CVS-induced brain damage, and I'm trying to teach you. You 
can give up, but that's really "refuse to see the damage that systems like 
RCS and CVS has done to the world"

The fundamental brain damage that CVS (and RCS, and SVN, and just about 
anything else) has had is thinking that "filenames" (and sometimes this is 
"fixed" to be "file ID's") are somehow special, and a totally separate 
thing from "file contents".

Really. It's a BUG. It's a deficiency in CVS and friends. And it's a 
deficiency that you have gotten so used to that you don't even see that 
it's simply obviously NOT TRUE.

You _cannot_ have a filename without the contents of that filename. That 
whole concept doesn't make sense, except in the twisted AND WRONG mental 
model of "files have identities even without content".

The whole point of git is that it is about "project state" and the history 
that binds those states together. People have kind of come to accept that, 
and a lot of people realize what it means, but I don't think you've really 
accepted what it means for something as simple as a "git add" command.

Again, totally ignore the index. Imagine that it doesn't exist. Imagine 
that you never actually learnt about it, and that none of the 
documentation ever mentions it, and just ask yourself:

	"What does 'adding a file' really mean?"

I mean _really_. It cannot be about the "filename", because a filename 
simply doesn't have any meaning alone. Remember what git is all about.

No, when you do a "git add", YOU DO NOT TALK ABOUT FILENAMES AT ALL.

	NOT EVEN CLOSE!

No. Git is, and has always been, all about tracking project content. The 
fact that CVS is crap, and thinks that "filenames" are special (and this 
causes major problems when you do renames), and the fact that SVN is crap, 
and things that "file identities" are special (and this causes major 
problems when you split a file or when two files join) is very much about 
THEIR F*CKING IDIOTIC FUNDAMENTAL BRAINDAMAGE!

So take five minutes to really think about that. Take an hour. Take a 
week. Ponder it.

What does it mean to "add" something to a project? It has _nothing_ to do 
with "filenames". Yeah, the filename obviously exists, but it's not 
something that exists on its own. You add the ONLY thing that git tracks. 

You add CONTENT.

When you do "git add file.c" you aren't adding a filename to the list of 
files that git knows about. Not even CLOSE. No. You are really adding 
_content_ to the project you are tracking. You haven't bound it to a 
commit yet, but it's there. It's there both conceptually, and very much in 
a real technical sense too (you've literally added the git object that 
that file describes to the object database - the "commit" and "tree" 
objects to tie it all together is just waiting to be added, but they 
really just expose it - the actual file object has already been created 
when you do "git add".)

So yes, you very much ARE talking about CVS braindamage. The reason why

	git add file.c
	echo New line >> file.c
	git commit

commits the _old_ content, is very much because git is ALL ABOUT THE 
CONTENT. It has _never_ been about filenames. And it _shouldn't_ be about 
filenames, because that would be BUGGY AND BROKEN.

Sorry for shouting, but as long as you think "git add" adds a filename, 
you're just not getting it. And I think it's really sad that you don't 
even seem to understand that yes, this _is_ braindamage that has been 
forced upon you by decades of mental rape done by bad source control 
systems.

Please. File identities are _bad_ in the SVN kind of setting. The CVS kind 
of "filename == file identity" is even _worse_, but it's still exactly the 
same disease. It's the disease of thinking that metadata is somehow 
"different" from real data, and that "files" have identities that are 
somehow separate from the data they contain.

Face it, git is consistent, and if it acted the way you seem to expect it 
to act, it would actually be a BUG. Exactly because you cannot and MUST 
NOT think that "filename" is something that has meaning without "file 
content" (or "file type" and "file permissions" - they all go together).

And notice? NONE OF THIS HAS ANYTHING AT ALL TO DO WITH 'INDEX'!! The 
explanation above is not "this is how the index works". It's a much more 
fundamnetal issue of getting the right mental model, where the only thing 
that matters is contents.

So even without an index, "git add" should work the way it works, once you 
can just let go of the broken model that is CVS.

Please. Join me, Luke. The power of the git side is stronger. I am your 
father. 


  reply	other threads:[~2006-11-30 19:56 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 21:31 [PATCH/RFC] "init-db" can really be just "init" Nicolas Pitre
2006-11-27 22:05 ` Junio C Hamano
2006-11-27 22:40   ` Hyphens and hiding core commands (was: "init-db" can really be just "init") Carl Worth
2006-11-27 23:59     ` Hyphens and hiding core commands Junio C Hamano
2006-11-28  0:23       ` Carl Worth
2006-11-28  0:42         ` Junio C Hamano
2006-11-28  1:35           ` Carl Worth
2006-11-28  2:18             ` Junio C Hamano
2006-11-28  5:40               ` Theodore Tso
2006-11-28  9:15                 ` Junio C Hamano
2006-11-29  7:14                   ` Michael S. Tsirkin
2006-11-28  6:59               ` [PATCH 0/2] Making "git commit" to mean "git commit -a" Junio C Hamano
2006-11-28 10:26                 ` Andy Whitcroft
2006-11-28 13:00                 ` Josef Weidendorfer
2006-11-28 13:23                   ` Jakub Narebski
2006-11-28 18:18                 ` Carl Worth
2006-11-29  3:06                   ` Junio C Hamano
2006-11-29  4:33                     ` Nicolas Pitre
2006-11-29  7:44                       ` Junio C Hamano
2006-11-29 18:08                         ` Nicolas Pitre
2006-11-29 18:18                           ` Jakub Narebski
2006-11-29 19:12                             ` Steven Grimm
2006-11-29 19:30                               ` Jakub Narebski
2006-11-29 18:53                           ` Junio C Hamano
2006-11-29 19:09                             ` Steven Grimm
2006-11-29 20:01                               ` Johannes Schindelin
2006-11-29 20:39                                 ` Junio C Hamano
2006-11-29 21:50                                   ` xdl_merge(), was " Johannes Schindelin
2006-11-30  5:24                                   ` Seth Falcon
2006-11-29 23:37                         ` Carl Worth
2006-11-29 23:53                           ` Johannes Schindelin
2006-11-30  1:03                           ` Junio C Hamano
2006-11-30  1:22                             ` Junio C Hamano
2006-11-30  1:58                               ` Steven Grimm
2006-11-30  2:04                                 ` Sam Vilain
2006-11-30  2:12                                 ` Junio C Hamano
2006-11-30  2:11                               ` Johannes Schindelin
2006-11-30  3:10                                 ` Linus Torvalds
2006-11-30 10:27                                   ` Johannes Schindelin
2006-11-30 11:09                                   ` Andreas Ericsson
2006-11-30 15:58                                     ` Linus Torvalds
2006-11-30 16:40                                       ` Theodore Tso
2006-11-30 17:13                                         ` Linus Torvalds
2006-11-30 17:37                                           ` Nicolas Pitre
2006-11-30 18:38                                             ` Carl Worth
2006-11-30 18:47                                               ` Jakub Narebski
2006-11-30 19:04                                                 ` Carl Worth
2006-12-01  8:44                                                   ` Andreas Ericsson
2006-12-01  9:31                                                     ` Han-Wen Nienhuys
2006-11-30 18:51                                               ` Carl Worth
2006-11-30 19:55                                                 ` Linus Torvalds [this message]
2006-11-30 20:47                                                   ` Nicolas Pitre
2006-11-30 21:03                                                     ` Linus Torvalds
2006-11-30 21:16                                                       ` Jakub Narebski
2006-11-30 21:37                                                         ` Carl Worth
2006-11-30 21:41                                                           ` Michael K. Edwards
2006-11-30 21:50                                                             ` Carl Worth
2006-11-30 21:58                                                               ` Jakub Narebski
2006-11-30 22:26                                                                 ` Johannes Schindelin
2006-11-30 22:07                                                           ` Josef Weidendorfer
2006-11-30 22:25                                                           ` Johannes Schindelin
2006-11-30 22:37                                                             ` Nicolas Pitre
2006-11-30 22:31                                                           ` Nicolas Pitre
2006-11-30 22:47                                                           ` Junio C Hamano
2006-12-01  8:34                                                       ` Andy Parkins
2006-12-01 23:33                                                         ` Alan Chandler
2006-11-30 21:19                                                     ` Junio C Hamano
2006-11-30 22:21                                                       ` Nicolas Pitre
2006-11-30 23:02                                                         ` Junio C Hamano
2006-11-30 23:40                                                           ` Linus Torvalds
2006-12-01  0:13                                                             ` Carl Worth
2006-12-01  0:21                                                               ` Linus Torvalds
2006-12-01  1:10                                                                 ` Carl Worth
2006-12-01  1:32                                                                   ` Linus Torvalds
2006-12-01  2:08                                                                     ` Carl Worth
2006-12-01  2:44                                                                       ` Linus Torvalds
2006-12-01  3:40                                                                         ` Carl Worth
2006-12-01  3:52                                                                         ` Michael K. Edwards
2006-12-01  0:24                                                             ` Junio C Hamano
     [not found]                                                           ` <Pine.LNX.4. 64.0611301520370.3513@woody.osdl.org>
2006-12-01  0:06                                                             ` Jakub Narebski
2006-12-01  1:20                                                           ` Nicolas Pitre
2006-12-01  8:59                                                         ` Andreas Ericsson
2006-12-01 23:36                                                           ` Alan Chandler
     [not found]                                                   ` <7vac28h898.fsf@assigned-by-dhcp.cox.net>
2006-11-30 22:46                                                     ` Nicolas Pitre
2006-11-30 22:55                                                     ` Johannes Schindelin
2006-11-30 21:33                                                 ` Robert Shearman
2006-11-30 21:41                                                   ` Jakub Narebski
2006-12-01 18:27                                                     ` Shawn Pearce
2006-12-02  7:48                                                     ` Marco Costalba
2006-11-30 18:09                                           ` Carl Worth
2006-11-30 18:33                                             ` Linus Torvalds
2006-11-30  0:52                     ` Daniel Barkalow
2006-11-30 12:23                 ` Salikh Zakirov
2006-11-30 13:16                   ` Jakub Narebski
2006-11-30 15:15                     ` Seth Falcon
2006-11-30 15:50                       ` Nguyen Thai Ngoc Duy
2006-11-30 16:03                         ` Seth Falcon
2006-11-30 16:05                       ` Jakub Narebski
2006-11-30 17:13                   ` Andy Whitcroft
2006-11-28  7:00               ` [PATCH 1/2] git-commit: prepare to make '-a' behaviour the default Junio C Hamano
2006-11-28  7:00               ` [PATCH 2/2] git-commit: make '-a' " Junio C Hamano
2006-11-28  9:09                 ` Jakub Narebski
2006-11-27 23:36   ` [PATCH/RFC] "init-db" can really be just "init" Johannes Schindelin
2006-11-28 10:45   ` Han-Wen Nienhuys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0611301132350.3513@woody.osdl.org \
    --to=torvalds@osdl.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=nico@cam.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).