Re: Cleaning up git user-interface warts

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Wednesday, November 15, 2006 - 4:33 pm

On Wed, 15 Nov 2006, Shawn Pearce wrote:

Actually, with different people involved it's _much_ better to do it in 
one shot.

Why? Because doing a separate "fetch to local space" + "merge from local 
space" actually loses the information on what you are merging.

It's a lot more useful to have a merge message like

	Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6

than one like

	Merge branch 'for-linus'

which is what you get if you fetched it first.

Of course, in a situation like git itself, where most of the merges are 
stuff that Junio has had pending in his own tree ('maint' branch etc), 
things are different. But in a system where people actually use separate 
trees, there really is an advantage to consider the fundamental operation 
to be the "pull", not the "merge".

Again, the kernel really is more distributed than most projects, but this 
is another thing people should recognize: git has been designed for "true 
distributed development". Not the "fake" kind. Not the "I merge mainly my 
own branches" kind of thing. Truly distributed.

And in a truly distributed situation, "pull" is strictly more powerful 
than a separate "fetch" + separate "merge".

In other words, an SCM that does "pull" is _better_ than an SCM that does 
"merge". You can implement "merge" as a special case of "pull" (which we 
do), but you cannot conveniently do it the other way around without having 
to tie them together some other way (ie you could have a "remember the 
last place we fetched this branch from in order to tie the fetch and the 
merge together" - but please realize that that is exactly what "pull" 
_is_).

So I will generally do a "git pull" (possibly followed by a "git reset 
--hard ORIG_HEAD" if I decided it wasn't good) over a "git fetch" + "git 
merge". Exactly because the "pull" operation is actually more powerful.

Maybe people who aren't in my position don't always appreciate the _power_ 
of git. The reason "merge" is a second-class citizen is simply because IT 
SHOULD BE.

			Linus
-
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: Cleaning up git user-interface warts, Jakub Narebski, (Tue Nov 14, 2:30 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Tue Nov 14, 2:34 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Tue Nov 14, 3:56 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Tue Nov 14, 6:48 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Tue Nov 14, 7:10 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Tue Nov 14, 7:27 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Tue Nov 14, 9:20 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Tue Nov 14, 9:58 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 11:03 am)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 11:43 am)
Re: Cleaning up git user-interface warts, Shawn Pearce, (Wed Nov 15, 11:49 am)
Re: Cleaning up git user-interface warts, Andy Parkins, (Wed Nov 15, 11:58 am)
Re: Cleaning up git user-interface warts, Marko Macek, (Wed Nov 15, 12:05 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 12:18 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 12:32 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Wed Nov 15, 12:39 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 1:09 pm)
Re: Cleaning up git user-interface warts, Petr Baudis, (Wed Nov 15, 1:12 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 1:21 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 1:26 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 1:40 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 1:41 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 1:50 pm)
Re: Cleaning up git user-interface warts, Carl Worth, (Wed Nov 15, 2:08 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 2:18 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 2:31 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 2:40 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 2:45 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 2:52 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 2:59 pm)
Re: Cleaning up git user-interface warts, Shawn Pearce, (Wed Nov 15, 3:07 pm)
Re: Cleaning up git user-interface warts, Sean, (Wed Nov 15, 3:28 pm)
Re: Cleaning up git user-interface warts, Carl Worth, (Wed Nov 15, 3:52 pm)
Re: Cleaning up git user-interface warts, Shawn Pearce, (Wed Nov 15, 4:02 pm)
Re: Cleaning up git user-interface warts, Sean, (Wed Nov 15, 4:07 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 4:33 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 5:08 pm)
Re: Cleaning up git user-interface warts, Theodore Tso, (Wed Nov 15, 6:14 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Wed Nov 15, 6:20 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 7:03 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Wed Nov 15, 7:30 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Wed Nov 15, 8:02 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 8:07 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Wed Nov 15, 8:12 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 8:27 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 8:35 pm)
Re: Cleaning up git user-interface warts, Nicolas Pitre, (Wed Nov 15, 8:43 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 9:07 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Wed Nov 15, 9:21 pm)
Re: Cleaning up git user-interface warts, Theodore Tso, (Wed Nov 15, 9:26 pm)
Re: Cleaning up git user-interface warts, Petr Baudis, (Wed Nov 15, 9:30 pm)
Re: Cleaning up git user-interface warts, Marko Macek, (Wed Nov 15, 11:07 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 3:45 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Thu Nov 16, 4:11 am)
Re: Cleaning up git user-interface warts, Alexandre Julliard, (Thu Nov 16, 4:34 am)
Re: Cleaning up git user-interface warts, Andreas Ericsson, (Thu Nov 16, 4:35 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Thu Nov 16, 4:47 am)
Re: Cleaning up git user-interface warts, Andreas Ericsson, (Thu Nov 16, 4:50 am)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 6:03 am)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 6:11 am)
Re: Cleaning up git user-interface warts, Petr Baudis, (Thu Nov 16, 7:01 am)
Re: Cleaning up git user-interface warts, Alexandre Julliard, (Thu Nov 16, 8:48 am)
Re: Cleaning up git user-interface warts, Theodore Tso, (Thu Nov 16, 9:07 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 9:23 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 9:30 am)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 9:37 am)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 9:42 am)
Re: Cleaning up git user-interface warts, Theodore Tso, (Thu Nov 16, 9:49 am)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 10:01 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 10:17 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 10:30 am)
multi-project repos (was Re: Cleaning up git user-interfac ..., Han-Wen Nienhuys, (Thu Nov 16, 10:40 am)
Re: Cleaning up git user-interface warts, Sean, (Thu Nov 16, 10:44 am)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Thu Nov 16, 10:57 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 10:57 am)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 11:13 am)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 11:23 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Thu Nov 16, 11:27 am)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 11:28 am)
Re: multi-project repos, Junio C Hamano, (Thu Nov 16, 11:33 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Thu Nov 16, 12:47 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 12:53 pm)
Re: multi-project repos (was Re: Cleaning up git user-inte ..., Johannes Schindelin, (Thu Nov 16, 3:21 pm)
Re: multi-project repos, Junio C Hamano, (Thu Nov 16, 3:44 pm)
Re: Cleaning up git user-interface warts, Johannes Schindelin, (Thu Nov 16, 4:00 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 4:22 pm)
Re: multi-project repos (was Re: Cleaning up git user-inte ..., Johannes Schindelin, (Thu Nov 16, 4:36 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 5:05 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Thu Nov 16, 5:13 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 5:27 pm)
Re: multi-project repos, Johannes Schindelin, (Thu Nov 16, 5:29 pm)
Re: Cleaning up git user-interface warts, Petr Baudis, (Thu Nov 16, 5:35 pm)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 5:37 pm)
Re: Cleaning up git user-interface warts, Linus Torvalds, (Thu Nov 16, 5:39 pm)
Re: Cleaning up git user-interface warts, Han-Wen Nienhuys, (Thu Nov 16, 5:52 pm)
Re: multi-project repos (was Re: Cleaning up git user-inte ..., Johannes Schindelin, (Thu Nov 16, 6:22 pm)
Re: Cleaning up git user-interface warts, Carl Worth, (Thu Nov 16, 6:25 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Thu Nov 16, 6:34 pm)
Re: multi-project repos (was Re: Cleaning up git user-inte ..., Johannes Schindelin, (Thu Nov 16, 7:16 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Thu Nov 16, 11:42 pm)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Fri Nov 17, 12:32 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Fri Nov 17, 1:41 am)
Re: Cleaning up git user-interface warts, Carl Worth, (Fri Nov 17, 2:18 am)
Re: Cleaning up git user-interface warts, Johannes Schindelin, (Fri Nov 17, 3:11 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Fri Nov 17, 4:29 am)
Re: Cleaning up git user-interface warts, Junio C Hamano, (Fri Nov 17, 4:41 am)
Re: Cleaning up git user-interface warts, Karl , (Fri Nov 17, 5:20 am)
Re: Cleaning up git user-interface warts, Shawn Pearce, (Fri Nov 17, 9:58 am)
Re: multi-project repos, Junio C Hamano, (Fri Nov 17, 10:39 am)
Re: multi-project repos, Junio C Hamano, (Fri Nov 17, 1:24 pm)
Re: Cleaning up git user-interface warts, Michael K. Edwards, (Fri Nov 17, 6:24 pm)
Re: multi-project repos, Shawn Pearce, (Fri Nov 17, 11:02 pm)
Re: multi-project repos, Junio C Hamano, (Sat Nov 18, 12:31 am)
Re: multi-project repos, Shawn Pearce, (Sat Nov 18, 12:45 am)
Re: Cleaning up git user-interface warts , Horst H. von Brand, (Mon Nov 20, 12:44 pm)
Re: Cleaning up git user-interface warts, Shawn Pearce, (Mon Nov 20, 12:46 pm)
Re: Cleaning up git user-interface warts, Jerome Lovy, (Tue Nov 21, 6:25 am)
Re: Cleaning up git user-interface warts , Sanjoy Mahajan, (Wed Nov 22, 4:21 pm)
Re: Cleaning up git user-interface warts , Horst H. von Brand, (Wed Nov 22, 7:52 pm)