Re: [PATCH v2 04/13] Teach rebase interactive the mark command
- From
- Jörg Sommer <joerg@alea.gnuu.de>
- Date
- Apr 22, 2008, 09:55 UTC
- Message-ID
- <20080422095549.GB3752@alea.gnuu.de>
- In-Reply-To
- <7vabjm78v2.fsf@gitster.siamese.dyndns.org>
Hi Junio,
Junio C Hamano schrieb am Mon 21. Apr, 22:32 (-0700):
Show 16 quoted lines
> Jörg Sommer <joerg@alea.gnuu.de> writes:
>
> > 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.What do you think about this version:
cleanup_before_quit () {
rm -rf "$DOTEST" &&
for ref in $(git for-each-ref --format='%(refname)' ${mark_prefix%/})
do
git update-ref -d "$ref" "$ref" || return 1
done
}Show 13 quoted lines
> > @@ -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?Use the same as fast-import and fix fast-import. :)
I've posted a new version <1208169584-15931-1-git-send-email-joerg@alea.gnuu.de>
Bye, Jörg.
-- Nutze die Talente, die du hast. Die Wälder wären sehr still, wenn nur die begabtesten Vögel sängen. (Henry van Dyke)