sm-sorcery-bugs AT lists.ibiblio.org
Subject: Bugs for Sorcery are reported here
List archive
[SM-Sorcery-Bugs] [Bug 15920] scribe update fails with modified git grimoire
- From: bugzilla-daemon AT bugs.sourcemage.org
- To: sm-sorcery-bugs AT lists.ibiblio.org
- Subject: [SM-Sorcery-Bugs] [Bug 15920] scribe update fails with modified git grimoire
- Date: 13 Dec 2011 09:50:16 -0000
http://bugs.sourcemage.org/show_bug.cgi?id=15920
Justin Boffemmyer <flux AT sourcemage.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |flux AT sourcemage.org
--- Comment #3 from Justin Boffemmyer <flux AT sourcemage.org> 2011-12-13
03:50:09 ---
Sorry I'm just commenting on this now. I've been kept busy for a while and
haven't been able to get around to as much as I used to.
There should be three changes (that I see immediately) to the most recent
patch:
1) Change the wording in the query to make it more clear what will really
happen:
- if query "Do you wand to clean git repository and try again?" n ;
then
+ if query "Force a git reset to origin/master and try again?" n ; then
2) Change HEAD to origin/master. So long as HEAD doesn't point to
origin/master, resetting to HEAD will be meaningless if there are local
changes
that were committed but not pushed back upstream. It also won't help if the
local repo is on a local branch that doesn't track upstream (i.e. a local
topic
branch). Both cases could cause an update to fail, because in the first case a
merge could be required, and in the second git wouldn't even know what to pull
in since it doesn't track anything.
- git reset --hard HEAD
+ git reset --hard origin/master
3) You need to change the order of the clean and reset. The reason is that
there may be items/changes in the working tree that are already committed
locally, in which case git clean would rightfully not clean them (since they
are "supposed" to be there). Resetting back to upstream may then make these
items untracked if they aren't part of the upstream repo, so then they could
be
cleaned. Oh, and you forgot the '&&' on the git reset line.
- echo "running 'git clean -d -f -q' and 'git reset --hard HEAD'" &&
- git clean -d -f -q &&
- git reset --hard HEAD
+ echo "running 'git reset --hard origin/master' and 'git clean -d -f
-q'" &&
+ git reset --hard origin/master &&
+ git clean -d -f -q &&
echo git pull &&
git pull
Note: if the "update" is performed via git fetch origin/master && git
reset --hard origin/master, then the git clean could technically be skipped
since the reset would simply force the working dir and HEAD state to match
whatever the tip of origin/master is after pulling down via the fetch:
- echo "running 'git clean -d -f -q' and 'git reset --hard HEAD'" &&
- git clean -d -f -q &&
- git reset --hard HEAD
- echo git pull &&
- git pull
+ echo "running 'git fetch origin/master' and 'git reset --hard
origin/master' &&
+ git fetch origin/master &&
+ git reset --hard origin/master
You can, of course, still perform the clean after the reset if you want to
ensure tidiness.
--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
- [SM-Sorcery-Bugs] [Bug 15920] scribe update fails with modified git grimoire, bugzilla-daemon, 12/13/2011
Archive powered by MHonArc 2.6.24.