From: Junio C Hamano Date: Tue, 22 Apr 2008 08:13:19 GMT Subject: Re: [PATCH v2 04/13] Teach rebase interactive the mark command Message-ID: <7vhcdu1f4w.fsf@gitster.siamese.dyndns.org> In-Reply-To: <7vabjm78v2.fsf@gitster.siamese.dyndns.org> Junio C Hamano writes: >> +mark_prefix=refs/rebase-marks/ >> + >> warn () { >> echo "$*" >&2 >> } >> @@ -105,7 +107,13 @@ die_with_patch () { >> } >> >> cleanup_before_quit () { >> - rm -rf "$DOTEST" >> + rm -rf "$DOTEST" && >> + for ref in "$GIT_DIR/$mark_prefix"* >> + do >> + test "$ref" = "$GIT_DIR/$mark_prefix*" && continue >> + git update-ref -d "${ref#$GIT_DIR/}" "${ref#$GIT_DIR/}" || \ >> + return 1 >> + done > > In practice nobody would "run" pack-refs during the rebase session, but I > have to wonder if it can be triggered to run as part of automated gc or > something, in which case this loop does not work as intended. It needs to > be rewritten using for-each-ref. > >> @@ -244,6 +252,19 @@ peek_next_command () { >> sed -n "1s/ .*$//p" < "$TODO" >> } >> >> +mark_to_ref () { >> + case "$1" in >> + :[!/]*) >> + # :/SOMETHING is a reference for the last commit whose >> + # message starts with SOMETHING >> + echo "$mark_prefix${1#:}" >> + ;; > > What was the conclusion of the mark-syntax discussion? Eh, sorry, I was commenting on a stale one. Disregard this part please. But the "$GIT_DIR/$mark_prefix/*" comment still stands. I've applied the series as is to 'next' so let's fix them up in-tree as needed.