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

Re: [BUG] git-rebase fails when a commit message contains a diff

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 9, 2007, 02:28 UTC
Message-ID
<Pine.LNX.4.64.0711090225110.4362@racer.site>
In-Reply-To
<7v640cxitc.fsf@gitster.siamese.dyndns.org>
Hi,
On Thu, 8 Nov 2007, Junio C Hamano wrote:
Show 8 quoted lines
> I wonder if this is a sensible thing to do, regardless of the issue of 
> commit log message that contains anything.
> 
> The patch replaces git-rebase with git-rebase--interactive.  The only 
> difference from the existing "git-rebase -i" is if the command is called 
> without "-i" the initial "here is the to-do list. please rearrange the 
> lines, modify 'pick' to 'edit' or whatever as appropriate" step is done 
> without letting the user edit the list.

Hmm. I don't know, really. I had the impression that the "git format-patch | git am" pipeline would be faster.

But if we were to do this, we'd get a progress meter for free. And bugs exposed, no doubt.

>  Makefile                                    |    2 +-
>  git-rebase--interactive.sh => git-rebase.sh |   14 ++++++++++----
>  2 files changed, 11 insertions(+), 5 deletions(-)
What about the existing git-rebase.sh?
Show 14 quoted lines
> diff --git a/git-rebase--interactive.sh b/git-rebase.sh
> similarity index 98%
> rename from git-rebase--interactive.sh
> rename to git-rebase.sh
> index 76dc679..1dd6f6d 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase.sh
> @@ -346,6 +347,9 @@ do_rest () {
>  while test $# != 0
>  do
>  	case "$1" in
> +	--interactive|-i)
> +		INTERACTIVE=t
> +		;;
There is already a case for that, further down.
Show 12 quoted lines
> @@ -504,9 +508,11 @@ EOF
>  			die_abort "Nothing to do"
>  
>  		cp "$TODO" "$TODO".backup
> -		git_editor "$TODO" ||
> -			die "Could not execute editor"
> -
> +		case "$INTERACTIVE" in
> +		t)
> +			git_editor "$TODO" || die "Could not execute editor"
> +			;;
> +		esac
Would that not be easier to read as
		test t = "$INTERACTIVE" &&
			git_editor "$TODO" || die "Could not execute editor"
Hmm?

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 17 in “[BUG] git-rebase fails when a commit message contains a diff”
  1. Jonas FonsecaNov 9, 2007
  2. Junio C HamanoNov 9, 2007
  3. Junio C HamanoNov 9, 2007
  4. Junio C HamanoNov 9, 2007
  5. Johannes SchindelinNov 9, 2007
  6. Junio C HamanoNov 9, 2007
  7. Johannes SchindelinNov 9, 2007
  8. Björn SteinbrinkNov 11, 2007
  9. Benoit SigoureNov 9, 2007
  10. Johannes SixtNov 9, 2007
  11. Ralf WildenhuesNov 9, 2007
  12. Benoit SigoureNov 9, 2007
  13. Johannes SchindelinNov 9, 2007
  14. Andreas EricssonNov 9, 2007
  15. Steffen ProhaskaNov 9, 2007
  16. Johannes SchindelinNov 9, 2007
  17. Steffen ProhaskaNov 9, 2007

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.