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: Johannes Schindelin <Johannes.Schindelin@...>
Cc: Jakub Narebski <jnareb@...>, Steffen Prohaska <prohaska@...>, Federico Mena Quintero <federico@...>, <git@...>
Date: Monday, October 22, 2007 - 8:44 am

Johannes Schindelin wrote:

diff
qgit
commit
fetch
rebase
merge
status
push
cherry-pick
grep
bisect
add
show-ref

If I were to suggest any improvements, it'd be to change the semantics 
of git-pull to always update the local branches set up to be merged with 
the remote tracking branches when they, prior to fetching, pointed to 
the same commit, such that when

$ git show-ref master
d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/heads/master
d4027a816dd0b416dc8c7b37e2c260e6905f11b6 refs/remotes/origin/master

refs/heads/master gets set to refs/remotes/origin/master post-fetch.

This would save me from this command sequence, which I currently have to 
do for git.

git fetch
git checkout next
git merge spearce/next
git checkout master
git merge spearce/master
git checkout maint
git merge spearce/maint
git checkout pu
git reset --hard spearce/pu

<rinse and repeat for every tracked branch>

git could definitely help here. I want the local branches to be 
up-to-date with the remote ones, because I frequently run diffs against 
the various branches to see if anything that I should be aware of has 
changed, and just as frequently I forget to add that 'origin/' prefix, 
which means I *might* be looking at old code.

I usually do that on internal projects, where we have "master", "next", 
"testing", and "stable" branches for pretty much every repo. We have 54 
git repos. The typing adds up. This is also one of the most frequent 
causes of confusion for my (even) less git-savvy co-workers. The 
argument usually goes like this:
"Umm... Peter, why did you commit your fix on top of 7 weeks old code?"
"Oh? I did git-pull first, just as you said, so it should have been the 
latest, shouldn't it?"
"Well, what branch were you on when you pulled?"
"Err.. does that matter? I didn't have any local modifications on the 
branch when I pulled, so it should have just updated it."

What's happened prior to such an argument is usually this:
next or master is inevitably checked out. The user does git-pull to get 
up to date. They then change branch and get down to business with 
rebasing, merging and editing. When it's time to push, git tells them 
"not a strict subset. use git-pull!", and they do, and sometimes it 
fails, and I have a hard time explaining why since I really don't see a 
reason for *not* updating all "to-merge" branches when they point to the 
same commit as their tracking-branch before the pull.

Patch to follow (at some point), although it's likely to make git-pull a 
built-in since I have no idea how to maintain coupled lists in shell.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
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..., Andreas Ericsson, (Mon Oct 22, 8:44 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)