www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/03/18/14:48:56

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Message-ID: <20150318184822.2124.qmail@stuge.se>
Date: Wed, 18 Mar 2015 19:48:22 +0100
From: Peter Stuge <peter AT stuge DOT se>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] pcb alternatives
Mail-Followup-To: geda-user AT delorie DOT com
References: <CAGYR9veihi_M+B0HXptGYQLMO8=B_KOLM2wmrRNkMLG_9MdQrA AT mail DOT gmail DOT com> <alpine DOT DEB DOT 2 DOT 00 DOT 1503180357520 DOT 25799 AT igor2priv> <CAGYR9ve_n7VmZ8x-jCQK5eKHMNGp6an9o8EwYZnWQWFiCpGnXg AT mail DOT gmail DOT com> <alpine DOT DEB DOT 2 DOT 00 DOT 1503180827170 DOT 25799 AT igor2priv> <CAC4O8c--CeEiKjxCKrs38XGjOyPS0Cy6scZ5HsAFgpi5xDpP_w AT mail DOT gmail DOT com> <201503181619 DOT t2IGJkZD012945 AT envy DOT delorie DOT com> <20150318165331 DOT 25228 DOT qmail AT stuge DOT se> <201503181709 DOT t2IH9StK014643 AT envy DOT delorie DOT com> <20150318174247 DOT 29231 DOT qmail AT stuge DOT se> <201503181744 DOT t2IHi8Im015958 AT envy DOT delorie DOT com>
MIME-Version: 1.0
In-Reply-To: <201503181744.t2IHi8Im015958@envy.delorie.com>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

DJ Delorie wrote:
> > What do you want?
> 
> I want "git update" to do what "cvs update" and "svn update" does -
> update the source tree under my work-in-progress.

I think this:

git config --global alias.update \
	'!git stash -a && git pull --rebase && git stash pop --index'

might do what you want. The only gotcha is that if your WIP stash
conflicts with what you've pulled, the stash will not get dropped.
You can just leave it sitting there, it doesn't matter too much.


If you don't mind losing track of what was git add:ed then another
idea is:

git config --global alias.update \
	'!f=$(mktemp) && git diff HEAD > "$f" && git reset --hard && \
	git pull --rebase && git apply "$f" && rm "$f"'

although much more clumsy, it could also do the trick.


This complexity is only needed if creating a few temporary commits
must always be avoided at all cost. It would be much simpler to
create temporary commits with the WIP and turn them into a single
proper commit in the end, when the work is finished.

Then:

git config --global alias.update 'pull --rebase'


//Peter

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019