Re: Considering teaching plumbing to users harmful
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 16, 2008, 22:41 UTC
- Message-ID
- <7vod4xo3j4.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080716223205.GK2167@mit.edu>
Theodore Tso <tytso@mit.edu> writes:
Show 12 quoted lines
> So from a pedagogical perspective, what I would probably do is show > them how to replicate svn-up, and explain to them how this script > works: > > #!/bin/sh > # git-up > > if git diff --quiet && git diff --quiet --cached ; then > git pull $* > else > git stash ; git pull $*; git stash pop > fi
Looks good, except:
if git diff ....; then
git pull "$@"
else
git stash && git pull "$@" && git stash pop
fito make sure the conflict notices won't be scrolled off by error messages from the later commands.