Fred Stluka on 21 Dec 2018 22:41:23 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Git: net time gain or loss?



On 12/21/18 5:54 PM, Rich Freeman wrote:
However, the fact that git commits are atomic at the repository level
is a very useful tool to help ensure this, in conjunction with
whatever other QA you impose.

Git doesn't guarantee that your commit works.  However, it does
guarantee that when somebody else checks out your commit they get the
exact state of the entire repository that you had when you made the
commit, no matter what else is going on, as long as you stick to
fast-forward pushes only.  If you and all your other committers are
doing systematic QA on each commit, then anybody bisecting the
repository should always land on working commits (at least as far as
your QA goes).
Right.  One of the things I love about Git is that a commit of multiple
files is atomic.  Before Git, every other VCS I used required me to
checkin each file separately.  So, if I changed multiple files as part of
a single bug fix or feature, it happened occasionally that someone
else would checkout while I was in the middle of my multiple checkins.
So they'd get part of my change, and things would fail.  Sometimes
in weird unexpected and unrepeatable ways, so they could lose a lot
of time before it occurred to them to just do a fresh checkout to fix
it.  And of course, that fresh checkout was subject to the same race
condition with file updates from me and others, so it might not
work either.

With Git, I "add" each file I change, staging them all to be part of
the next "commit".  Then I do an atomic commit, so anyone else
who pulls from the repo gets all of my changes or none.  Atomic
is critical here.  I railed against the lack of it for years, to lots of
people who often didn't even understand the problem, before I
finally moved to Git.  Ah...  Much better!...

--Fred
------------------------------------------------------------------------
Fred Stluka -- Bristle Software, Inc. -- http://bristle.com
#DontBeATrump -- Make America Honorable Again!
------------------------------------------------------------------------

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug