git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS
@ 2012-06-07 11:53 Torsten Bögershausen
  2012-06-07 14:20 ` konglu
  0 siblings, 1 reply; 15+ messages in thread
From: Torsten Bögershausen @ 2012-06-07 11:53 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Torsten Bögershausen


commit a63d7ed3017e312ddc752ac89a7d292a745d5f11
Author: Lucien Kong <Lucien.Kong@ensimag.imag.fr>
Date:   Wed Jun 6 12:34:16 2012 +0200

    rebase [-i --exec | -ix] <cmd>...
....
    Tests about this new command are also added in t3404-rebase-interactive.sh.
....


This test doesn't pass on my Mac Os box.

I run it with --debug --verbose, and it looks like another sed problem on Mac OS, may be.
(My sed is /usr/bin, Mac OS X 10.6.8)

I haven't been able to dig very deep into this, but the line  
"sed: 1: "/^pick .*/i\t\t\t\texec  gi ...": command i expects \ followed by text"
looks suspicious.

Could the same be achieved by using tail instead of sed?
Anybody else having this problem?


====================

ok 54 - rebase-i history with funny messages

expecting success: 
	git checkout master &&
	git checkout -b execute &&
	test_commit one_exec main.txt one_exec &&
	test_commit two_exec main.txt two_exec &&
	test_commit three_exec main.txt three_exec

Switched to branch 'master'
Switched to a new branch 'execute'
[execute 925b01e] one_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 main.txt
[execute 7f87cbe] two_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
[execute f0f177e] three_exec
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+), 1 deletion(-)
ok 55 - prepare for rebase -i --exec

expecting success: 
	git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
	(
		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
		export FAKE_LINES &&
		git rebase -i HEAD~2 >expected
	) &&
	sed 1,9d expected >expect &&
	mv expect expected &&
	test_cmp expected actual

sed: 1: "/^pick .*/i\t\t\t\texec  gi ...": command i expects \ followed by text
Successfully rebased and updated refs/heads/execute.
Successfully rebased and updated refs/heads/execute.
--- expected	2012-06-07 11:46:53.000000000 +0000
+++ actual	2012-06-07 11:46:52.000000000 +0000
@@ -1,18 +1,4 @@
-Rebasing (2/4)
Executing: git show HEAD
-commit 8f99a4f1fbbd214b25a070ad34ec5a8f833522cc
-Author: A U Thor <author@example.com>
-Date:   Thu Apr 7 15:17:13 2005 -0700
-
-    E
-
-diff --git a/file3 b/file3
-new file mode 100644
-index 0000000..1c50726
---- /dev/null
-+++ b/file3
-@@ -0,0 +1 @@
-+E
-Rebasing (3/4)
Rebasing (4/4)
Executing: git show HEAD
+Rebasing (1/1)
Executing: git show HEAD
 commit 925b01e149bd188d43f972ad86d1e4d6611c8fa0
 Author: A U Thor <author@example.com>
 Date:   Thu Apr 7 16:10:13 2005 -0700
not ok - 56 running "git rebase -i --exec git show HEAD"

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS
  2012-06-07 11:53 commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS Torsten Bögershausen
@ 2012-06-07 14:20 ` konglu
  2012-06-07 16:14   ` Torsten Bögershausen
  0 siblings, 1 reply; 15+ messages in thread
From: konglu @ 2012-06-07 14:20 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Git Mailing List


Torsten Bögershausen <tboegi@web.de> a écrit :

> commit a63d7ed3017e312ddc752ac89a7d292a745d5f11
> Author: Lucien Kong <Lucien.Kong@ensimag.imag.fr>
> Date:   Wed Jun 6 12:34:16 2012 +0200
>
>     rebase [-i --exec | -ix] <cmd>...
> ....
>     Tests about this new command are also added in  
> t3404-rebase-interactive.sh.
> ....
>
>
> This test doesn't pass on my Mac Os box.
>
> I run it with --debug --verbose, and it looks like another sed  
> problem on Mac OS, may be.
> (My sed is /usr/bin, Mac OS X 10.6.8)
>
> I haven't been able to dig very deep into this, but the line
> "sed: 1: "/^pick .*/i\t\t\t\texec  gi ...": command i expects \  
> followed by text"
> looks suspicious.

Does it work if the whitespaces are deleted so that it becomes
/^pick .*/i\exec gi..." ? (see the patch corrected below).


-------->8 ------
 From 1820dd24d6c93e0ba3b7a19a205f0fce79777751 Mon Sep 17 00:00:00 2001
From: Kong Lucien <Lucien.Kong@ensimag.imag.fr>
Date: Sat, 2 Jun 2012 13:04:19 +0200
Subject: rebase [-i --exec | -ix] <CMD>...

This patch provides a way to automatically add these "exec" lines
between each commit applications. For instance, running 'git rebase -i
--exec "make test"' lets you check that intermediate commits are
compilable. It is also compatible with the option --autosquash. At
this point, you can't use --exec without the interactive mode (-i).

Tests about this new command are also added in
t3404-rebase-interactive.sh.

Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr>
---
  Documentation/git-rebase.txt  |   54 +++++++++++++++--
  git-rebase--interactive.sh    |   18 ++++++
  git-rebase.sh                 |   20 ++++++-
  t/t3404-rebase-interactive.sh |  124  
+++++++++++++++++++++++++++++++++++++++++
  4 files changed, 206 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 147fa1a..1dd95c4 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -8,9 +8,9 @@ git-rebase - Forward-port local commits to the updated  
upstream head
  SYNOPSIS
  --------
  [verse]
-'git rebase' [-i | --interactive] [options] [--onto <newbase>]
+'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
  	[<upstream>] [<branch>]
-'git rebase' [-i | --interactive] [options] --onto <newbase>
+'git rebase' [-i | --interactive] [options] [--exec <cmd>] --onto <newbase>
  	--root [<branch>]
  'git rebase' --continue | --skip | --abort

@@ -210,11 +210,29 @@ rebase.autosquash::

  OPTIONS
  -------
-<newbase>::
-	Starting point at which to create the new commits. If the
-	--onto option is not specified, the starting point is
-	<upstream>.  May be any valid commit, and not just an
-	existing branch name.
+-x <cmd>::
+--exec <cmd>::
+	Automatically add "exec" followed by <cmd> between each commit
+	applications. Using this option along with --autosquash adds
+	the exec line after the squash/fixeup series only. <cmd>
+	stands for shell commands. The --exec option has to be
+	specified. (see INTERACTIVE MODE below)
++
+This has to be used along with the `--interactive` option explicitly.
+You may execute several commands between each commit applications.
+For this, you can use one instance of exec:
+	git rebase -i --exec "cmd1; cmd2; ...".
+You can also insert several instances of exec, if you wish to
+only have one command per line for example:
+	git rebase -i --exec "cmd1" --exec "cmd2" ...
+
+--onto <newbase>::
+	With this option, git rebase takes all commits from <branch>,
+	that are not in <upstream>, and transplant them on top of
+	<newbase>. <newbase> is the starting point at which to create
+	the new commits. If the --onto option is not specified, the
+	starting point is <upstream>.  May be any valid commit, and
+	not just an existing branch name.
  +
  As a special case, you may use "A\...B" as a shortcut for the
  merge base of A and B if there is exactly one merge base. You can
@@ -521,6 +539,28 @@ in `$SHELL`, or the default shell if `$SHELL` is  
not set), so you can
  use shell features (like "cd", ">", ";" ...). The command is run from
  the root of the working tree.

+----------------------------------
+$ git rebase -i --exec "make test"
+----------------------------------
+
+This command lets you check that intermediate commits are compilable.
+The todo list becomes like that:
+
+--------------------
+pick 5928aea one
+exec make test
+pick 04d0fda two
+exec make test
+pick ba46169 three
+exec make test
+pick f4593f9 four
+exec make test
+--------------------
+
+If the option '-i' is missing, The command will return a message
+error. If there is no <cmd> specified behind --exec, the command will
+return a message error and the usage page of 'git rebase'.
+
  SPLITTING COMMITS
  -----------------

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0c19b7c..dc9e7e9 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -684,6 +684,22 @@ rearrange_squash () {
  	rm -f "$1.sq" "$1.rearranged"
  }

+# Add commands after a pick or after a squash/fixup serie
+# in the todo list.
+add_exec_commands () {
+	OIFS=$IFS
+	IFS=$LF
+	for i in $cmd
+	do
+		tmp=$(sed "/^pick .*/i\exec $i" "$1")
+		echo "$tmp" >"$1"
+		tmp=$(sed '1d' "$1")
+		echo "$tmp" >"$1"
+		echo "exec $i" >>"$1"
+	done
+	IFS=$OIFS
+}
+
  case "$action" in
  continue)
  	# do we have anything to commit?
@@ -857,6 +873,8 @@ fi

  test -s "$todo" || echo noop >> "$todo"
  test -n "$autosquash" && rearrange_squash "$todo"
+test -n "$cmd" && add_exec_commands "$todo"
+
  cat >> "$todo" << EOF

  # Rebase $shortrevisions onto $shortonto
diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..19ead1a 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -3,7 +3,8 @@
  # Copyright (c) 2005 Junio C Hamano.
  #

-USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--no-ff]  
[--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'
+USAGE='[--interactive | -i] [--exec | -x <cmd>] [-v] [--force-rebase | -f]
+       [--no-ff] [--onto <newbase>] [<upstream>|--root] [<branch>]  
[--quiet | -q]'
  LONG_USAGE='git-rebase replaces <branch> with a new branch of the
  same name.  When the --onto option is provided the new branch starts
  out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
@@ -30,8 +31,8 @@ Example:       git-rebase master~1 topic
  SUBDIRECTORY_OK=Yes
  OPTIONS_KEEPDASHDASH=
  OPTIONS_SPEC="\
-git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
-git rebase [-i] [options] --onto <newbase> --root [<branch>]
+git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>]  
[<upstream>] [<branch>]
+git rebase [-i] [options] [--exec <cmd>] --onto <newbase> --root [<branch>]
  git-rebase [-i] --continue | --abort | --skip
  --
   Available options are
@@ -43,6 +44,7 @@ s,strategy=!       use the given merge strategy
  no-ff!             cherry-pick all commits, even if unchanged
  m,merge!           use merging strategies to rebase
  i,interactive!     let the user edit the list of commits to rebase
+x,exec=!           add exec lines after each commit of the editable list
  k,keep-empty	   preserve empty commits during rebase
  f,force-rebase!    force rebase even if branch is up to date
  X,strategy-option=! pass the argument through to the merge strategy
@@ -76,6 +78,7 @@ If you would prefer to skip this patch, instead run  
\"git rebase --skip\".
  To check out the original branch and stop rebasing run \"git rebase  
--abort\".
  "
  unset onto
+cmd=
  strategy=
  strategy_opts=
  do_merge=
@@ -219,6 +222,11 @@ do
  		onto="$2"
  		shift
  		;;
+	-x)
+		test 2 -le "$#" || usage
+		cmd="${cmd:+"$cmd$LF"} $2"
+		shift
+		;;
  	-i)
  		interactive_rebase=explicit
  		;;
@@ -304,6 +312,12 @@ do
  done
  test $# -gt 2 && usage

+if test -n "$cmd" &&
+   test "$interactive_rebase" != explicit
+then
+	die "--exec option must be used with --interactive option\n"
+fi
+
  if test -n "$action"
  then
  	test -z "$in_progress" && die "No rebase in progress?"
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 025c1c6..4fe98d5 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -755,4 +755,128 @@ test_expect_success 'rebase-i history with funny  
messages' '
  	test_cmp expect actual
  '

+
+test_expect_success 'prepare for rebase -i --exec' '
+	git checkout master &&
+	git checkout -b execute &&
+	test_commit one_exec main.txt one_exec &&
+	test_commit two_exec main.txt two_exec &&
+	test_commit three_exec main.txt three_exec
+'
+
+
+test_expect_success 'running "git rebase -i --exec git show HEAD"' '
+	git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'running "git rebase --exec git show HEAD -i"' '
+	git reset --hard execute &&
+	git rebase --exec "git show HEAD" -i HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'running "git rebase -ix git show HEAD"' '
+	git reset --hard execute &&
+	git rebase -ix "git show HEAD" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with several <CMD>' '
+	git reset --hard execute &&
+	git rebase -ix "git show HEAD; pwd" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD;_pwd 2 exec_git_show_HEAD;_pwd" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with several instances of --exec' '
+	git reset --hard execute &&
+	git rebase -i --exec "git show HEAD" --exec "pwd" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD exec_pwd 2
+				exec_git_show_HEAD exec_pwd" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,11d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with --autosquash' '
+	git reset --hard execute &&
+	git checkout -b autosquash &&
+	echo second >second.txt &&
+	git add second.txt &&
+	git commit -m "fixup! two_exec" &&
+	echo bis >bis.txt &&
+	git add bis.txt &&
+	git commit -m "fixup! two_exec" &&
+	(
+		git checkout -b autosquash_actual &&
+		git rebase -i --exec "git show HEAD" --autosquash HEAD~4 >actual
+	) &&
+	git checkout autosquash &&
+	(
+		git checkout -b autosquash_expected &&
+		FAKE_LINES="1 fixup 3 fixup 4 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~4 >expected
+	) &&
+	sed '1,13d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase --exec without -i shows error message' '
+	git reset --hard execute &&
+	test_must_fail git rebase --exec "git show HEAD" HEAD~2 2>actual &&
+	echo "--exec option must be used with --interactive option\n" >expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -i --exec without <CMD> shows error  
message and usage' '
+	git reset --hard execute &&
+	test_must_fail git rebase -i --exec 2>actual &&
+	sed '1d' actual >tmp &&
+	mv tmp actual &&
+	test_must_fail git rebase -h >expected &&
+	test_cmp expected actual &&
+	git checkout master
+'
+
  test_done
-- 
1.7.8

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS
  2012-06-07 14:20 ` konglu
@ 2012-06-07 16:14   ` Torsten Bögershausen
  2012-06-07 16:40     ` konglu
  2012-06-07 16:46     ` rebase [-i --exec | -ix] <CMD> Lucien Kong
  0 siblings, 2 replies; 15+ messages in thread
From: Torsten Bögershausen @ 2012-06-07 16:14 UTC (permalink / raw)
  To: konglu; +Cc: Torsten Bögershausen, Git Mailing List

On 07.06.12 16:20, konglu@minatec.inpg.fr wrote:
> Does it work if the whitespaces are deleted so that it becomes
> /^pick .*/i\exec gi..." ? (see the patch corrected below).


I didn't manage to appy the patch, either 
fatal: corrupt patch at line 14
or, if I remove that line
line 14 is bad, or there is no email address.

Does the patch apply on your system ?
/Torsten

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS
  2012-06-07 16:14   ` Torsten Bögershausen
@ 2012-06-07 16:40     ` konglu
  2012-06-07 16:46     ` rebase [-i --exec | -ix] <CMD> Lucien Kong
  1 sibling, 0 replies; 15+ messages in thread
From: konglu @ 2012-06-07 16:40 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Git Mailing List


Torsten Bögershausen <tboegi@web.de> a écrit :

> On 07.06.12 16:20, konglu@minatec.inpg.fr wrote:
>> Does it work if the whitespaces are deleted so that it becomes
>> /^pick .*/i\exec gi..." ? (see the patch corrected below).
>
>
> I didn't manage to appy the patch, either
> fatal: corrupt patch at line 14
> or, if I remove that line
> line 14 is bad, or there is no email address.
>
> Does the patch apply on your system ?
> /Torsten

Sorry, doesn't work on mine too. Gonna send a proper patch.

Lucien Kong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* rebase [-i --exec | -ix] <CMD>...
  2012-06-07 16:14   ` Torsten Bögershausen
  2012-06-07 16:40     ` konglu
@ 2012-06-07 16:46     ` Lucien Kong
  2012-06-07 17:57       ` Torsten Bögershausen
  2012-06-07 20:59       ` Johannes Sixt
  1 sibling, 2 replies; 15+ messages in thread
From: Lucien Kong @ 2012-06-07 16:46 UTC (permalink / raw)
  To: tboegi; +Cc: git, Lucien Kong

The whitespaces before exec have been deleted. Does it
work now on MacOS ?

---
 Documentation/git-rebase.txt  |   54 +++++++++++++++--
 git-rebase--interactive.sh    |   18 ++++++
 git-rebase.sh                 |   20 ++++++-
 t/t3404-rebase-interactive.sh |  124 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 206 insertions(+), 10 deletions(-)

diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 147fa1a..1dd95c4 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -8,9 +8,9 @@ git-rebase - Forward-port local commits to the updated upstream head
 SYNOPSIS
 --------
 [verse]
-'git rebase' [-i | --interactive] [options] [--onto <newbase>]
+'git rebase' [-i | --interactive] [options] [--exec <cmd>] [--onto <newbase>]
 	[<upstream>] [<branch>]
-'git rebase' [-i | --interactive] [options] --onto <newbase>
+'git rebase' [-i | --interactive] [options] [--exec <cmd>] --onto <newbase>
 	--root [<branch>]
 'git rebase' --continue | --skip | --abort
 
@@ -210,11 +210,29 @@ rebase.autosquash::
 
 OPTIONS
 -------
-<newbase>::
-	Starting point at which to create the new commits. If the
-	--onto option is not specified, the starting point is
-	<upstream>.  May be any valid commit, and not just an
-	existing branch name.
+-x <cmd>::
+--exec <cmd>::
+	Automatically add "exec" followed by <cmd> between each commit
+	applications. Using this option along with --autosquash adds
+	the exec line after the squash/fixeup series only. <cmd>
+	stands for shell commands. The --exec option has to be
+	specified. (see INTERACTIVE MODE below)
++
+This has to be used along with the `--interactive` option explicitly.
+You may execute several commands between each commit applications.
+For this, you can use one instance of exec:
+	git rebase -i --exec "cmd1; cmd2; ...".
+You can also insert several instances of exec, if you wish to
+only have one command per line for example:
+	git rebase -i --exec "cmd1" --exec "cmd2" ...
+
+--onto <newbase>::
+	With this option, git rebase takes all commits from <branch>,
+	that are not in <upstream>, and transplant them on top of
+	<newbase>. <newbase> is the starting point at which to create
+	the new commits. If the --onto option is not specified, the
+	starting point is <upstream>.  May be any valid commit, and
+	not just an existing branch name.
 +
 As a special case, you may use "A\...B" as a shortcut for the
 merge base of A and B if there is exactly one merge base. You can
@@ -521,6 +539,28 @@ in `$SHELL`, or the default shell if `$SHELL` is not set), so you can
 use shell features (like "cd", ">", ";" ...). The command is run from
 the root of the working tree.
 
+----------------------------------
+$ git rebase -i --exec "make test"
+----------------------------------
+
+This command lets you check that intermediate commits are compilable.
+The todo list becomes like that:
+
+--------------------
+pick 5928aea one
+exec make test
+pick 04d0fda two
+exec make test
+pick ba46169 three
+exec make test
+pick f4593f9 four
+exec make test
+--------------------
+
+If the option '-i' is missing, The command will return a message
+error. If there is no <cmd> specified behind --exec, the command will
+return a message error and the usage page of 'git rebase'.
+
 SPLITTING COMMITS
 -----------------
 
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0c19b7c..dc9e7e9 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -684,6 +684,22 @@ rearrange_squash () {
 	rm -f "$1.sq" "$1.rearranged"
 }
 
+# Add commands after a pick or after a squash/fixup serie
+# in the todo list.
+add_exec_commands () {
+	OIFS=$IFS
+	IFS=$LF
+	for i in $cmd
+	do
+		tmp=$(sed "/^pick .*/i\exec $i" "$1")
+		echo "$tmp" >"$1"
+		tmp=$(sed '1d' "$1")
+		echo "$tmp" >"$1"
+		echo "exec $i" >>"$1"
+	done
+	IFS=$OIFS
+}
+
 case "$action" in
 continue)
 	# do we have anything to commit?
@@ -857,6 +873,8 @@ fi
 
 test -s "$todo" || echo noop >> "$todo"
 test -n "$autosquash" && rearrange_squash "$todo"
+test -n "$cmd" && add_exec_commands "$todo"
+
 cat >> "$todo" << EOF
 
 # Rebase $shortrevisions onto $shortonto
diff --git a/git-rebase.sh b/git-rebase.sh
index 24a2840..19ead1a 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -3,7 +3,8 @@
 # Copyright (c) 2005 Junio C Hamano.
 #
 
-USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--no-ff] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'
+USAGE='[--interactive | -i] [--exec | -x <cmd>] [-v] [--force-rebase | -f]
+       [--no-ff] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'
 LONG_USAGE='git-rebase replaces <branch> with a new branch of the
 same name.  When the --onto option is provided the new branch starts
 out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>
@@ -30,8 +31,8 @@ Example:       git-rebase master~1 topic
 SUBDIRECTORY_OK=Yes
 OPTIONS_KEEPDASHDASH=
 OPTIONS_SPEC="\
-git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
-git rebase [-i] [options] --onto <newbase> --root [<branch>]
+git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>] [<branch>]
+git rebase [-i] [options] [--exec <cmd>] --onto <newbase> --root [<branch>]
 git-rebase [-i] --continue | --abort | --skip
 --
  Available options are
@@ -43,6 +44,7 @@ s,strategy=!       use the given merge strategy
 no-ff!             cherry-pick all commits, even if unchanged
 m,merge!           use merging strategies to rebase
 i,interactive!     let the user edit the list of commits to rebase
+x,exec=!           add exec lines after each commit of the editable list
 k,keep-empty	   preserve empty commits during rebase
 f,force-rebase!    force rebase even if branch is up to date
 X,strategy-option=! pass the argument through to the merge strategy
@@ -76,6 +78,7 @@ If you would prefer to skip this patch, instead run \"git rebase --skip\".
 To check out the original branch and stop rebasing run \"git rebase --abort\".
 "
 unset onto
+cmd=
 strategy=
 strategy_opts=
 do_merge=
@@ -219,6 +222,11 @@ do
 		onto="$2"
 		shift
 		;;
+	-x)
+		test 2 -le "$#" || usage
+		cmd="${cmd:+"$cmd$LF"} $2"
+		shift
+		;;
 	-i)
 		interactive_rebase=explicit
 		;;
@@ -304,6 +312,12 @@ do
 done
 test $# -gt 2 && usage
 
+if test -n "$cmd" &&
+   test "$interactive_rebase" != explicit
+then
+	die "--exec option must be used with --interactive option\n"
+fi
+
 if test -n "$action"
 then
 	test -z "$in_progress" && die "No rebase in progress?"
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 025c1c6..4fe98d5 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -755,4 +755,128 @@ test_expect_success 'rebase-i history with funny messages' '
 	test_cmp expect actual
 '
 
+
+test_expect_success 'prepare for rebase -i --exec' '
+	git checkout master &&
+	git checkout -b execute &&
+	test_commit one_exec main.txt one_exec &&
+	test_commit two_exec main.txt two_exec &&
+	test_commit three_exec main.txt three_exec
+'
+
+
+test_expect_success 'running "git rebase -i --exec git show HEAD"' '
+	git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'running "git rebase --exec git show HEAD -i"' '
+	git reset --hard execute &&
+	git rebase --exec "git show HEAD" -i HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'running "git rebase -ix git show HEAD"' '
+	git reset --hard execute &&
+	git rebase -ix "git show HEAD" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with several <CMD>' '
+	git reset --hard execute &&
+	git rebase -ix "git show HEAD; pwd" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD;_pwd 2 exec_git_show_HEAD;_pwd" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,9d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with several instances of --exec' '
+	git reset --hard execute &&
+	git rebase -i --exec "git show HEAD" --exec "pwd" HEAD~2 >actual &&
+	(
+		FAKE_LINES="1 exec_git_show_HEAD exec_pwd 2
+				exec_git_show_HEAD exec_pwd" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~2 >expected
+	) &&
+	sed '1,11d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -ix with --autosquash' '
+	git reset --hard execute &&
+	git checkout -b autosquash &&
+	echo second >second.txt &&
+	git add second.txt &&
+	git commit -m "fixup! two_exec" &&
+	echo bis >bis.txt &&
+	git add bis.txt &&
+	git commit -m "fixup! two_exec" &&
+	(
+		git checkout -b autosquash_actual &&
+		git rebase -i --exec "git show HEAD" --autosquash HEAD~4 >actual
+	) &&
+	git checkout autosquash &&
+	(
+		git checkout -b autosquash_expected &&
+		FAKE_LINES="1 fixup 3 fixup 4 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
+		export FAKE_LINES &&
+		git rebase -i HEAD~4 >expected
+	) &&
+	sed '1,13d' expected >expect &&
+	mv expect expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase --exec without -i shows error message' '
+	git reset --hard execute &&
+	test_must_fail git rebase --exec "git show HEAD" HEAD~2 2>actual &&
+	echo "--exec option must be used with --interactive option\n" >expected &&
+	test_cmp expected actual
+'
+
+
+test_expect_success 'rebase -i --exec without <CMD> shows error message and usage' '
+	git reset --hard execute &&
+	test_must_fail git rebase -i --exec 2>actual &&
+	sed '1d' actual >tmp &&
+	mv tmp actual &&
+	test_must_fail git rebase -h >expected &&
+	test_cmp expected actual &&
+	git checkout master
+'
+
 test_done
-- 
1.7.8

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 16:46     ` rebase [-i --exec | -ix] <CMD> Lucien Kong
@ 2012-06-07 17:57       ` Torsten Bögershausen
  2012-06-07 18:07         ` konglu
  2012-06-07 20:59       ` Johannes Sixt
  1 sibling, 1 reply; 15+ messages in thread
From: Torsten Bögershausen @ 2012-06-07 17:57 UTC (permalink / raw)
  To: Lucien Kong; +Cc: tboegi, git

Still no success :-(
Please see below:



git checkout a63d7ed3017e312ddc752ac89a7d292
tb@birne:~/projects/git/git.git> git am --abort ; git am < 1339089425.H311811P3927.appes.lan\:2\,S

Applying: rebase [-i --exec | -ix] <CMD>...
error: patch failed: Documentation/git-rebase.txt:8
error: Documentation/git-rebase.txt: patch does not apply
error: patch failed: git-rebase--interactive.sh:684
error: git-rebase--interactive.sh: patch does not apply
error: patch failed: git-rebase.sh:3
error: git-rebase.sh: patch does not apply
error: patch failed: t/t3404-rebase-interactive.sh:755
error: t/t3404-rebase-interactive.sh: patch does not apply
Patch failed at 0001 rebase [-i --exec | -ix] <CMD>...
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 17:57       ` Torsten Bögershausen
@ 2012-06-07 18:07         ` konglu
  2012-06-07 19:10           ` Torsten Bögershausen
  0 siblings, 1 reply; 15+ messages in thread
From: konglu @ 2012-06-07 18:07 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Lucien Kong, git


Torsten Bögershausen <tboegi@web.de> a écrit :

> Still no success :-(
> Please see below:
>
> git checkout a63d7ed3017e312ddc752ac89a7d292
> tb@birne:~/projects/git/git.git> git am --abort ; git am <  
> 1339089425.H311811P3927.appes.lan\:2\,S
>
> Applying: rebase [-i --exec | -ix] <CMD>...
> error: patch failed: Documentation/git-rebase.txt:8
> error: Documentation/git-rebase.txt: patch does not apply
> error: patch failed: git-rebase--interactive.sh:684
> error: git-rebase--interactive.sh: patch does not apply
> error: patch failed: git-rebase.sh:3
> error: git-rebase.sh: patch does not apply
> error: patch failed: t/t3404-rebase-interactive.sh:755
> error: t/t3404-rebase-interactive.sh: patch does not apply
> Patch failed at 0001 rebase [-i --exec | -ix] <CMD>...
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".

On which branch are you applying the patch ? It should works on
branch master (it works for me) but it won't on branch "pu", as
it has already been queued.

Lucien Kong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 18:07         ` konglu
@ 2012-06-07 19:10           ` Torsten Bögershausen
  2012-06-07 19:55             ` konglu
  0 siblings, 1 reply; 15+ messages in thread
From: Torsten Bögershausen @ 2012-06-07 19:10 UTC (permalink / raw)
  To: konglu; +Cc: Torsten Bögershausen, Lucien Kong, git

On 07.06.12 20:07, konglu@minatec.inpg.fr wrote:
> On which branch are you applying the patch ? It should works on
> branch master (it works for me) but it won't on branch "pu", as
> it has already been queued.
>
> Lucien Kong
>
Thanks, now the patch applies on master.
But it seems that the problem is still there:
================
[snip]
ok 55 - prepare for rebase -i --exec

expecting success:
    git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
    (
        FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
        export FAKE_LINES &&
        git rebase -i HEAD~2 >expected
    ) &&
    sed 1,9d expected >expect &&
    mv expect expected &&
    test_cmp expected actual

sed: 1: "/^pick .*/i\exec  git s ...": extra characters after \ at the end of i command
Successfully rebased and updated refs/heads/execute.
Successfully rebased and updated refs/heads/execute.
--- expected    2012-06-07 19:07:51.000000000 +0000
+++ actual    2012-06-07 19:07:50.000000000 +0000
@@ -1,18 +1,4 @@
-Rebasing (2/4)
Executing: git show HEAD
-commit 8f99a4f1fbbd214b25a070ad34ec5a8f833522cc
-Author: A U Thor <author@example.com>
-Date:   Thu Apr 7 15:17:13 2005 -0700
-
-    E
-
-diff --git a/file3 b/file3
-new file mode 100644
-index 0000000..1c50726
---- /dev/null
-+++ b/file3
-@@ -0,0 +1 @@
-+E
-Rebasing (3/4)
Rebasing (4/4)
Executing: git show HEAD
+Rebasing (1/1)
Executing: git show HEAD
 commit 925b01e149bd188d43f972ad86d1e4d6611c8fa0
 Author: A U Thor <author@example.com>
 Date:   Thu Apr 7 16:10:13 2005 -0700
not ok - 56 running "git rebase -i --exec git show HEAD"
[snip]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 19:10           ` Torsten Bögershausen
@ 2012-06-07 19:55             ` konglu
  2012-06-07 20:35               ` Andreas Schwab
  2012-06-07 20:49               ` Matthieu Moy
  0 siblings, 2 replies; 15+ messages in thread
From: konglu @ 2012-06-07 19:55 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: Lucien Kong, git


Torsten Bögershausen <tboegi@web.de> a écrit :

> On 07.06.12 20:07, konglu@minatec.inpg.fr wrote:
>> On which branch are you applying the patch ? It should works on
>> branch master (it works for me) but it won't on branch "pu", as
>> it has already been queued.
>>
>> Lucien Kong
>>
> Thanks, now the patch applies on master.
> But it seems that the problem is still there:
> ================
> [snip]
> ok 55 - prepare for rebase -i --exec
>
> expecting success:
>     git rebase -i --exec "git show HEAD" HEAD~2 >actual &&
>     (
>         FAKE_LINES="1 exec_git_show_HEAD 2 exec_git_show_HEAD" &&
>         export FAKE_LINES &&
>         git rebase -i HEAD~2 >expected
>     ) &&
>     sed 1,9d expected >expect &&
>     mv expect expected &&
>     test_cmp expected actual
>
> sed: 1: "/^pick .*/i\exec  git s ...": extra characters after \ at  
> the end of i command
> Successfully rebased and updated refs/heads/execute.
> Successfully rebased and updated refs/heads/execute.
> --- expected    2012-06-07 19:07:51.000000000 +0000
> +++ actual    2012-06-07 19:07:50.000000000 +0000
> @@ -1,18 +1,4 @@
> -Rebasing (2/4)
> Executing: git show HEAD
> -commit 8f99a4f1fbbd214b25a070ad34ec5a8f833522cc
> -Author: A U Thor <author@example.com>
> -Date:   Thu Apr 7 15:17:13 2005 -0700
> -
> -    E
> -
> -diff --git a/file3 b/file3
> -new file mode 100644
> -index 0000000..1c50726
> ---- /dev/null
> -+++ b/file3
> -@@ -0,0 +1 @@
> -+E
> -Rebasing (3/4)
> Rebasing (4/4)
> Executing: git show HEAD
> +Rebasing (1/1)
> Executing: git show HEAD
>  commit 925b01e149bd188d43f972ad86d1e4d6611c8fa0
>  Author: A U Thor <author@example.com>
>  Date:   Thu Apr 7 16:10:13 2005 -0700
> not ok - 56 running "git rebase -i --exec git show HEAD"
> [snip]

As you pointed out, the problem seems to come from this line
	tmp=$(sed "/^pick .*/i\exec $i" "$1")
I think that the dquote here doesn't work on MacOS, though i've
never tried it. Anyway, even if it's not the problem, this kind
of quoting is quite odd so it will be removed in the next patch
(I do not see other reasons of the issue, as sed's i command should
work on MacOS).

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 19:55             ` konglu
@ 2012-06-07 20:35               ` Andreas Schwab
  2012-06-07 20:44                 ` konglu
  2012-06-07 20:49               ` Matthieu Moy
  1 sibling, 1 reply; 15+ messages in thread
From: Andreas Schwab @ 2012-06-07 20:35 UTC (permalink / raw)
  To: konglu; +Cc: Torsten Bögershausen, Lucien Kong, git

konglu@minatec.inpg.fr writes:

> As you pointed out, the problem seems to come from this line
> 	tmp=$(sed "/^pick .*/i\exec $i" "$1")
> I think that the dquote here doesn't work on MacOS, though i've
> never tried it. Anyway, even if it's not the problem, this kind
> of quoting is quite odd so it will be removed in the next patch
> (I do not see other reasons of the issue, as sed's i command should
> work on MacOS).

You need to put a newline after the backslash.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 20:35               ` Andreas Schwab
@ 2012-06-07 20:44                 ` konglu
  2012-06-07 21:12                   ` Andreas Schwab
  0 siblings, 1 reply; 15+ messages in thread
From: konglu @ 2012-06-07 20:44 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Torsten Bögershausen, Lucien Kong, git

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=";"; format=flowed	DelSp=Yes, Size: 826 bytes --]


Andreas Schwab <schwab@linux-m68k.org> a écrit :

> konglu@minatec.inpg.fr writes:
>
>> As you pointed out, the problem seems to come from this line
>> 	tmp=$(sed "/^pick .*/i\exec $i" "$1")
>> I think that the dquote here doesn't work on MacOS, though i've
>> never tried it. Anyway, even if it's not the problem, this kind
>> of quoting is quite odd so it will be removed in the next patch
>> (I do not see other reasons of the issue, as sed's i command should
>> work on MacOS).
>
> You need to put a newline after the backslash.

That's what we originally did. Though we did it with indentations:
         tmp=$(sed "/^pick .*/i\
                            exec $i" "$1")
Should it be put that way (without indentations) ?
         tmp=$(sed "/^pick .*/i\
exec $i" "$1")

Thanks,

Lucien Kong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 19:55             ` konglu
  2012-06-07 20:35               ` Andreas Schwab
@ 2012-06-07 20:49               ` Matthieu Moy
  1 sibling, 0 replies; 15+ messages in thread
From: Matthieu Moy @ 2012-06-07 20:49 UTC (permalink / raw)
  To: konglu; +Cc: Torsten Bögershausen, Lucien Kong, git

konglu@minatec.inpg.fr writes:

> As you pointed out, the problem seems to come from this line
> 	tmp=$(sed "/^pick .*/i\exec $i" "$1")
> I think that the dquote here doesn't work on MacOS, though i've
> never tried it.

I don't see a reason why it wouldn't. Anyway, quotes are managed by the
shell, and in our case, sed is the one complaining.

I experimented a bit, and it seems Mac OS's sed insists in having a \
and a newline after i (it seems POSIX requires it too). In your code
above, the \ is included in double quotes, so you have to escape it.

This snippet works reliably on my Linux machine and on a Mac OS X one:

x=$(echo 'pick foo' | sed -e "/pick/i\\
exec $1")
echo "$x"

> Anyway, even if it's not the problem, this kind of quoting is quite
> odd so it will be removed in the next patch

Be careful, you do need quoting around $i.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 16:46     ` rebase [-i --exec | -ix] <CMD> Lucien Kong
  2012-06-07 17:57       ` Torsten Bögershausen
@ 2012-06-07 20:59       ` Johannes Sixt
  2012-06-08 15:34         ` Junio C Hamano
  1 sibling, 1 reply; 15+ messages in thread
From: Johannes Sixt @ 2012-06-07 20:59 UTC (permalink / raw)
  To: Lucien Kong; +Cc: tboegi, git

Am 07.06.2012 18:46, schrieb Lucien Kong:
> +# Add commands after a pick or after a squash/fixup serie
> +# in the todo list.
> +add_exec_commands () {
> +	OIFS=$IFS
> +	IFS=$LF
> +	for i in $cmd
> +	do
> +		tmp=$(sed "/^pick .*/i\exec $i" "$1")
> +		echo "$tmp" >"$1"
> +		tmp=$(sed '1d' "$1")
> +		echo "$tmp" >"$1"
> +		echo "exec $i" >>"$1"
> +	done
> +	IFS=$OIFS
> +}

How about this?

	{
		first=t
		while read -r insn rest
		do
			case $insn in
			pick)
				test -n "$first" ||
				printf "%s" "$cmd"
				;;
			esac
			printf "%s %s\n" "$insn" "$rest"
			first=
		done
		printf "%s" "$cmd"
	} <"$1" >"$1.new" &&
	mv "$1.new" "$1"

together with:

> +	-x)
> +		test 2 -le "$#" || usage
> +		cmd="${cmd:+"$cmd$LF"} $2"
> +		shift
> +		;;

		cmd="${cmd}exec $2${LF}"

(I did not test this.)

-- Hannes

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 20:44                 ` konglu
@ 2012-06-07 21:12                   ` Andreas Schwab
  0 siblings, 0 replies; 15+ messages in thread
From: Andreas Schwab @ 2012-06-07 21:12 UTC (permalink / raw)
  To: konglu; +Cc: Torsten Bögershausen, Lucien Kong, git

konglu@minatec.inpg.fr writes:

> That's what we originally did. Though we did it with indentations:
>          tmp=$(sed "/^pick .*/i\
>                             exec $i" "$1")

Inside double quotes \<newline> is removed.  You need to double the
backslash.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: rebase [-i --exec | -ix] <CMD>...
  2012-06-07 20:59       ` Johannes Sixt
@ 2012-06-08 15:34         ` Junio C Hamano
  0 siblings, 0 replies; 15+ messages in thread
From: Junio C Hamano @ 2012-06-08 15:34 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: Lucien Kong, tboegi, git

Johannes Sixt <j6t@kdbg.org> writes:

> How about this?
>
> 	{
> 		first=t
> 		while read -r insn rest
> 		do
> 			case $insn in
> 			pick)
> 				test -n "$first" ||
> 				printf "%s" "$cmd"
> 				;;
> 			esac
> 			printf "%s %s\n" "$insn" "$rest"
> 			first=
> 		done
> 		printf "%s" "$cmd"
> 	} <"$1" >"$1.new" &&
> 	mv "$1.new" "$1"
>
> together with:
> ...

This is my favorite version among the ones I've seen so far.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-06-08 15:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-07 11:53 commit a63d7ed3017e312ddc752ac89a7d292a745d5f11 broken on MacOS Torsten Bögershausen
2012-06-07 14:20 ` konglu
2012-06-07 16:14   ` Torsten Bögershausen
2012-06-07 16:40     ` konglu
2012-06-07 16:46     ` rebase [-i --exec | -ix] <CMD> Lucien Kong
2012-06-07 17:57       ` Torsten Bögershausen
2012-06-07 18:07         ` konglu
2012-06-07 19:10           ` Torsten Bögershausen
2012-06-07 19:55             ` konglu
2012-06-07 20:35               ` Andreas Schwab
2012-06-07 20:44                 ` konglu
2012-06-07 21:12                   ` Andreas Schwab
2012-06-07 20:49               ` Matthieu Moy
2012-06-07 20:59       ` Johannes Sixt
2012-06-08 15:34         ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).