>From time to time I will make some blog-like comments here about my
(new) experiences with git from the point of view of a long-time
subversion user.  I encourage and welcome further discussion of these
topics as we all learn to work together on PLplot development with
git.

Remember the three file status's (unstaged, staged, and committed)
that are emphasized so much by the Pro Git book?

Intellectually I know these distinctions are important, but they still
caught me by suprise today.  It turns out that both unstaged and
staged git changes persist between different branch checkouts.  So I
wasn't paying enough attention to which branch I was on when I looked
at git status results.  My eyes skipped over that extremely important
line in the output about the branch, and I saw there was a subset of
the unstaged changes that I wanted to stage (with git add) and commit.
So I did that.  The result (much to my surprise and chagrin) was the
commit was made on the master branch rather than the desired topic
branch.  This all happened after I had done a similar add and commit
for a different subset of my changes on the topic branch. The net
result was a merge from topic branch to master could not be a ff-only
merge as demanded by our workflow given in README.developers.  I got
out of that mess by rebasing my topic branch with master then ff-only
merging my topic branch onto master to continue to maintain a linear
history for master locally and also for our SF repo when I pushed that
result.

In conclusion, to reduce such screwups for yourself, pay close
attention to the part of "git status" output that identifies the
branch you have checked out when you are deciding which subset of your
changes indicated by "git status" you want to add (stage) and commit. 
If such "wrong branch" commits like above do occur, "git log --oneline
-5" (or whatever number of commits you need to track back to find the
common origin commit of master and topic branches) for your master and
topic branches will help you figure out the mess.  In no case should
you ever do anything but a ff-only merge with our adopted git workflow
that is documented in README.developers.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to