git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Completion: Hint whether amend is the right thing to do.

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2008, 15:53 UTC
Message-ID
<7v63sywhkr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<200805281608.02000.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> writes:
Show 33 quoted lines
> When you get a conflict during interactive rebase the next
> thing to do is not to amend, but to continue the rebase.
> With this change you get a reminder in the prompt.
>
> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
> ---
>  contrib/completion/git-completion.bash |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> I got a couple of broken rebases. Hence this fix.
>
> -- robin
>
> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> index 1698463..a606328 100755
> --- a/contrib/completion/git-completion.bash
> +++ b/contrib/completion/git-completion.bash
> @@ -82,7 +82,12 @@ __git_ps1 ()
>  			b="$(git symbolic-ref HEAD 2>/dev/null)"
>  		elif [ -f "$g/.dotest-merge/interactive" ]
>  		then
> -			r="|REBASE-i"
> +			if [ -f "$g/.dotest-merge/amend" ]
> +			then
> +				r="|REBASE-i-amend"
> +			else
> +				r="|REBASE-i-continue"
> +			fi
>  			b="$(cat "$g/.dotest-merge/head-name")"
>  		elif [ -d "$g/.dotest-merge" ]
>  		then
> -- 
> 1.5.5.1.178.g1f811

Hmm. The "|REBASE-blah" prefix is already too long for my liking and this makes it even longer X-<

Does this mean that it would help reduce mistakes if "git commit --amend" noticed the presense of .dotest-merge but absense of .dotest-merge/amend and refused to operate, I have to wonder?

Previous: Robin RosenbergNext: Shawn O. Pearce
Message 2 of 6 in “Completion: Hint whether amend is the right thing to do.”
  1. Completion: Hint whether amend is the right thing to do.Robin Rosenberg, May 28, 2008
  2. Junio C HamanoMay 28, 2008
  3. Shawn O. PearceMay 28, 2008
  4. Robin RosenbergMay 28, 2008
  5. Junio C HamanoMay 28, 2008
  6. Shawn O. PearceMay 28, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.