git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Simon Sasburg <simon.sasburg@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/3] Implement --dirty for git-rebase--interactive.
Date: Mon, 12 Nov 2007 11:51:54 -0800	[thread overview]
Message-ID: <7vpryf2qed.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1193952624-608-3-git-send-email-Simon.Sasburg@gmail.com

Simon Sasburg <simon.sasburg@gmail.com> writes:

> +restore_dirty_state () {
> +	lastmsg=$(git-rev-list HEAD^..HEAD --pretty=oneline | sed "s:[^ ]* ::")
> +	if test "$lastmsg" = "REBASE--dirty: store index..workingtree diff"
> +	then
> +		echo "Restoring dirty index state"
> +		git reset --mixed HEAD^
> +	fi
> +	lastmsg=$(git-rev-list HEAD^..HEAD --pretty=oneline | sed "s:[^ ]* ::")
> +	if test "$lastmsg" = "REBASE--dirty: store HEAD..index diff"
> +	then
> +		echo "Restoring dirty working dir state"
> +		git reset --soft HEAD^
> +	fi
> +}

This forces the user to pay the two rev-list overhead, even when
running rebase without --dirty option.  Can we avoid paying any,
when not giving the option?

Also it pollutes the reflog of the branch, but that won't be a
huge issue with Dscho's "detach HEAD while rebasing" patch.

  parent reply	other threads:[~2007-11-12 19:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 21:30 [RFC PATCH 0/3] Starting rebase from dirty tree Simon Sasburg
2007-11-01 21:30 ` [PATCH 1/3] Introduce --dirty option to git-rebase, allowing you to start from a dirty state Simon Sasburg
2007-11-01 21:30   ` [PATCH 2/3] Implement --dirty for git-rebase--interactive Simon Sasburg
2007-11-01 21:30     ` [PATCH 3/3] Make git-svn rebase --dirty pass along --dirty to git-rebase Simon Sasburg
2007-11-12 19:51     ` Junio C Hamano [this message]
2007-11-01 22:30   ` [PATCH 1/3] Introduce --dirty option to git-rebase, allowing you to start from a dirty state Junio C Hamano
2007-11-01 22:36     ` Junio C Hamano
2007-11-02  5:08       ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpryf2qed.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=simon.sasburg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).