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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Federico Mena Quintero
Date: Thursday, October 25, 2007 - 9:06 am

On Wed, 2007-10-24 at 23:14 +0100, Johannes Schindelin wrote:

[snip]

This is a *very* powerful concept.  Unfortunately, it is not 100% clear
in the documentation, at least not when you are reading about
fetch/merge/pull initially.

After reading the user's manual, I just could not understand what
"fetch" does, and therefore "merge" and "pull" did not make sense.  I
could not understand where Git stored the new changes from upstream
while also keeping my working directory in the same state it was.  After
10 years of using CVS/SVN, the assumption you have is, "whenever I get
changes from the remote repository, they will be visible in my working
copy (and merge conflicts are a fact of life)".

Some time later, I ran into "Git for computer scientists" and then
finally I got it, thanks to the nice diagrams and explanation.  I
realized how powerful a concept "fetch" is:  THIS is the right way to
examine what upstream worked on while you did your own local work.

Once you understand what's going on, however, it is not obvious how to
*visualize* the state of things after you do "git fetch".  Probably
"gitk --all" is the correct way to do it, but the presentation is not
ideal --- you have to hunt down the list of commits until you find your
own "master" (or whatever branch), and *there* is where you can say,
"oh, this is where we diverged; now let's see what I'll get when I
rebase later".

So, a few problems so far, with possible solutions:

* The docs do not make it easy to understand what git-fetch does.  Can
we just cut&paste most of "Git for computer scientists" into the Git
user's manual?).

* It's not obvious how to visualize the state after git-fetch, i.e.
"gitk --all" is not the first thing that occurs to you.  Maybe git-fetch
should suggest you to run "gitk --all" when your remotes get changes, so
that you can see what's going on?

* It's hard to find the "divergence point" in gitk's display, since you
have to scroll down the reverse-chronological list of commits until you
find your local refs and where they started diverging.  Would there be a
way to "flatten" the display a bit, so your local stuff is always easy
to find, and yet it's easy to see what the remote changes were?


.. And after I understood what "fetch" does, "rebase" became obvious,
and *this* is where I started loving Git.  I understood that in the past
all I had been doing with CVS was to rebase by hand; that is where I
said "Git is such a powerful tool".


It's a matter of perception.  CVS requires *less* steps, even if you do
more manual work.  To commit something, you need to

  cvs update
  <resolve conflicts by hand - they are a fact of life, remember?>
  cvs commit

Whereas with Git you need

  git fetch
  git rebase <huh, what was the name of the remote branch?>
  <fix conflicts>
  git commit
  git push

[Maybe that's not 100% the right sequence, but you know what I mean.]

So your perception is that you have to fiddle more with Git (look up the
remote branch name, invoke more git commands), even if Git saved you a
lot of work when rebasing.

When you start using a complex tool like CVS or Git, you do it by
voodoo:  you learn sequences of commands, but you don't really
understand what they do.  If one tool makes you use less comands, it is
perceived as simpler and more powerful ("because the other one needs
more babysitting").

So, Git needs to make it very clear from the beginning (in the user's
manual or the distilled tutorials) that it has *very powerful* concepts
at your disposal.  It needs to *teach you* how it will save you a lot of
work when compared to traditional tools like CVS.

  Federico

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