Re: best git practices, was Re: Git User's Survey 2007 unfinished summary continued

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Steffen Prohaska <prohaska@...>
Cc: Peter Baumann <waste.manager@...>, Andreas Ericsson <ae@...>, J. Bruce Fields <bfields@...>, Jakub Narebski <jnareb@...>, Federico Mena Quintero <federico@...>, <git@...>
Date: Wednesday, October 24, 2007 - 6:14 pm

Hi,

On Wed, 24 Oct 2007, Steffen Prohaska wrote:


I am more concerned about having very fuzzy meanings of our nomenclature. 
As of now, "pull = fetch + merge".  You want to change that, and I am sure 
that it is harder to explain, Andreas' insistence on my being wrong 
notwithstanding.

Whenever I told people "pull = fetch + merge", they got it.  Often I would 
start a talk about git by introducing distributed development.  By stating 
that working in a working directory is already forking, only without 
commiting.  Then I'd go into details, by saying that there are multiple 
repositories, and that you can update local copies of the remote branches 
by "git fetch".  And you can merge by "git merge".  And then I would write 
down on the blackboard -- the first written thing in my talk! -- pull = 
fetch + merge.

My "pupils" _always_ liked the preciseness of the nomenclature.  And they 
made many less mistakes because they had a clear mental model of what is 
remote, and what is local.  And that local branches are always forks.


And here I have to disagree strongly.  In a workflow based on a shared 
repository, you do not want to merge.  You want to rebase.  First thing 
you do when switching to another branch is fetch + rebase (that's why I 
want an option to "pull --rebase" other branches).

But _even if_ you merge instead of rebase, I fail to see how the current 
situation is different from CVS (which many people maintain is _easier_ 
than gi), where first thing you do is to "cvs update".  Just for git it is 
"git pull".

But I think I have to drive my message home again: if what you desire 
becomes reality, you take away the clear distinction between local 
and remote branches.  In fact, those branches are neither local (because 
the next pull will automatically update them with remote changes, but 
_only_ if they fast-forward) nor remote (because you plan to work on them 
locally).

But here is a proposal which should make you and your developers happy, 
_and_ should be even easier to explain:

Work with topic branches.  And when you're done, delete them.

So the beginning of the day could look like this:

	git fetch
	git checkout -b todays-topic origin/master

	[hack hack hack]
	[test test test]
	[debug debug debug]
	[occasionally commit]
	[occasionally git rebase -i origin/master]

and the end of the topic

	git branch -M master
	git push origin master

If you should not be ready to push by the end of the day, no need to 
worry.  Just stay on that topic branch, and before pushing, do

	git fetch
	git rebase origin/master

In _every_ case where I explained git, I found that people appreciated the 
two-step procedures (like you will find in the examples I showed you 
above): one git command to work locally, and one to push/fetch to/from 
origin.

Ciao,
Dscho

-
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: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 8, 4:55 pm)
Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Fri Oct 12, 6:08 pm)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Fri Oct 12, 11:04 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Fri Oct 12, 8:46 pm)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Fri Oct 19, 4:57 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 20, 4:03 am)
Re: Git User's Survey 2007 unfinished summary continued, Steffen Prohaska, (Sat Oct 20, 6:19 am)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 21, 6:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sat Oct 20, 7:06 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 20, 7:33 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 21, 3:17 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 21, 6:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Mon Oct 22, 6:53 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Mon Oct 22, 3:59 am)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Mon Oct 22, 10:53 am)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 22, 7:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Mon Oct 22, 8:26 am)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Mon Oct 22, 10:29 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Mon Oct 22, 9:45 am)
best git practices, was Re: Git User's Survey 2007 unfinishe..., Johannes Schindelin, (Mon Oct 22, 7:04 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Mon Oct 22, 11:24 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Nguyen Thai Ngoc Duy, (Mon Oct 22, 9:36 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 9:38 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 9:48 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Mon Oct 22, 10:31 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Tue Oct 23, 6:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 12:16 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:07 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 6:17 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:12 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 7:39 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 6:14 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 12:06 pm)
[PATCH] Make rebase smarter, Steven Walter, (Fri Oct 26, 12:41 am)
Re: [PATCH] Make rebase smarter, Johannes Schindelin, (Fri Oct 26, 5:57 am)
Re: [PATCH] Make rebase smarter, Andreas Ericsson, (Fri Oct 26, 3:42 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 2:06 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Wed Oct 24, 7:28 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:17 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Thu Oct 25, 10:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Thu Oct 25, 2:02 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 8:58 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Thu Oct 25, 6:27 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 11:00 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Andreas Ericsson, (Mon Oct 22, 11:16 am)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Federico Mena Quintero, (Mon Oct 22, 3:36 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Johannes Schindelin, (Mon Oct 22, 7:21 pm)
Re: best git practices, was Re: Git User's Survey 2007 unfin..., Steffen Prohaska, (Mon Oct 22, 11:42 am)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 20, 7:29 am)
Re: Git User's Survey 2007 unfinished summary continued, Dmitry Potapov, (Sun Oct 21, 2:08 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Fri Oct 19, 7:37 pm)
Re: Git User's Survey 2007 unfinished summary continued, Federico Mena Quintero, (Mon Oct 22, 10:28 am)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Fri Oct 19, 7:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sat Oct 13, 3:59 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sun Oct 14, 5:49 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Matthew Andrews, (Sun Oct 14, 6:23 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:30 pm)
Re: Git User's Survey 2007 unfinished summary continued, Jakub Narebski, (Sun Oct 14, 6:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 14, 6:08 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 6:17 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sat Oct 13, 4:27 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 8:36 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 9:13 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 10:06 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 4:45 am)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sun Oct 14, 5:21 am)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Sat Oct 13, 9:44 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Sun Oct 14, 2:12 pm)
Re: Git User's Survey 2007 unfinished summary continued, Nicolas Pitre, (Sun Oct 14, 3:44 pm)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Mon Oct 15, 7:20 pm)
Re: Git User's Survey 2007 unfinished summary continued, Nicolas Pitre, (Mon Oct 15, 10:48 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Tue Oct 16, 6:51 am)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 14, 2:40 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 3:50 pm)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sun Oct 14, 4:18 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Sun Oct 14, 4:24 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sun Oct 14, 4:22 pm)
Re: Git User's Survey 2007 unfinished summary continued, Steven Grimm, (Sun Oct 14, 3:25 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 11:15 pm)
Re: Git User's Survey 2007 unfinished summary continued, Linus Torvalds, (Sat Oct 13, 11:55 pm)
Re: Git User's Survey 2007 unfinished summary continued, David Kastrup, (Sat Oct 13, 4:57 pm)
Re: Git User's Survey 2007 unfinished summary continued, Andreas Ericsson, (Sat Oct 13, 2:00 pm)
Re: Git User's Survey 2007 unfinished summary continued, Frank Lichtenheld, (Sat Oct 13, 8:58 am)
Re: Git User's Survey 2007 unfinished summary continued, Johannes Schindelin, (Sat Oct 13, 9:04 am)
Re: Git User's Survey 2007 unfinished summary continued, Shawn O. Pearce, (Fri Oct 12, 10:53 pm)
Re: Git User's Survey 2007 unfinished summary continued, J. Bruce Fields, (Fri Oct 12, 10:13 pm)
Re: Git User's Survey 2007 unfinished summary continued, Frank Lichtenheld, (Fri Oct 12, 7:36 pm)