git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Move redo merge code in a function
@ 2008-03-23 21:42 Jörg Sommer
  2008-03-23 21:42 ` [PATCH 2/4] Rework redo_merge Jörg Sommer
  2008-03-23 22:26 ` [PATCH 1/4] Move redo merge code in a function Johannes Schindelin
  0 siblings, 2 replies; 108+ messages in thread
From: Jörg Sommer @ 2008-03-23 21:42 UTC (permalink / raw)
  To: git; +Cc: gitster, B.Steinbrink, Jörg Sommer


Signed-off-by: Jörg Sommer <joerg@alea.gnuu.de>
---
 git-rebase--interactive.sh |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 8aa7371..1b2381e 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -113,6 +113,22 @@ has_action () {
 	grep '^[^#]' "$1" >/dev/null
 }
 
+redo_merge() {
+	author_script=$(get_author_ident_from_commit $sha1)
+	eval "$author_script"
+	msg="$(git cat-file commit $sha1 | sed -e '1,/^$/d')"
+	if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
+		GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
+		GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
+		output git merge $STRATEGY -m "$msg" \
+			$new_parents
+	then
+		git rerere
+		printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
+		die Error redoing merge $sha1
+	fi
+}
+
 pick_one () {
 	no_ff=
 	case "$1" in -n) sha1=$2; no_ff=t ;; *) sha1=$1 ;; esac
@@ -180,22 +196,9 @@ pick_one_preserving_merges () {
 		echo $sha1 > "$DOTEST"/current-commit
 		case "$new_parents" in
 		' '*' '*)
-			# redo merge
-			author_script=$(get_author_ident_from_commit $sha1)
-			eval "$author_script"
-			msg="$(git cat-file commit $sha1 | sed -e '1,/^$/d')"
 			# No point in merging the first parent, that's HEAD
 			new_parents=${new_parents# $first_parent}
-			if ! GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
-				GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
-				GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
-				output git merge $STRATEGY -m "$msg" \
-					$new_parents
-			then
-				git rerere
-				printf "%s\n" "$msg" > "$GIT_DIR"/MERGE_MSG
-				die Error redoing merge $sha1
-			fi
+			redo_merge
 			;;
 		*)
 			output git cherry-pick "$@" ||
-- 
1.5.4.4

^ permalink raw reply related	[flat|nested] 108+ messages in thread
* Re: [PATCH/RFC 01/10] Teach rebase interactive the mark command
@ 2008-04-13 20:51 Paul Fredrickson
  2008-04-14  9:27 ` Jörg Sommer
  2008-04-14 14:10 ` Johannes Schindelin
  0 siblings, 2 replies; 108+ messages in thread
From: Paul Fredrickson @ 2008-04-13 20:51 UTC (permalink / raw)
  To: git; +Cc: joerg, junio, Johannes.Schindelin

> Jrg Sommer <joerg@alea.gnuu.de> wrote:
> > > Wouldn't
> > >
> > > pick 5cc8f37 (init: show "Reinit" message even in ...)
> > > mark 1
> > > pick 18d077c (quiltimport: fix misquoting of parse...)
> > > mark 2
> > > reset 1
> >
> > "reset 18d077c~2" or "reset some-tag" or "reset my-branch~12"
> >
> >         merge #2
> > >
> > > be easier for people?
> >
> > I don't know. Using the special sign everywhere a mark is used looks more
> > consistent to me. The only case where it might be omitted is the mark
> > command, because it only uses marks.
>
> Why not use the mark syntax that fast-import uses?  In fast-import
> we use ":n" anytime we need to refer to a mark, e.g. ":1" or ":5".
> Its the same idea.  We already have a language for it.  Heck, the
> commands above are bordering on a language not too far from the
> one that fast-import accepts.  :-)

I like the idea of adding marks to an interactive rebase in general, but instead
of adding a separate command, what if rebase *automatically* marked all the
commits in the session:

    1: pick 5cc8f37 (init: show "Reinit" message even in ...)
    2: pick 18d007c (quiltimport: fix misquoting of parse ...)
    reset 1
    merge 2

or "reset :1" and "merge :2".  Neither notation bothers me for marks.

--Paul

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

end of thread, other threads:[~2008-05-04 13:09 UTC | newest]

Thread overview: 108+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-23 21:42 [PATCH 1/4] Move redo merge code in a function Jörg Sommer
2008-03-23 21:42 ` [PATCH 2/4] Rework redo_merge Jörg Sommer
2008-03-23 21:42   ` [PATCH 3/4] Add a function for get the parents of a commit Jörg Sommer
2008-03-23 21:42     ` [PATCH 4/4] git-rebase -i: New option to support rebase with merges Jörg Sommer
2008-03-23 22:41       ` Johannes Schindelin
2008-03-24 11:14         ` Jörg Sommer
2008-03-24 13:08           ` Johannes Schindelin
2008-03-24 23:40             ` Jörg Sommer
2008-03-24 18:35           ` Junio C Hamano
2008-03-24 23:30             ` Junio C Hamano
2008-03-25 10:13             ` Jörg Sommer
2008-03-26  8:02               ` Junio C Hamano
2008-04-09 23:58             ` Teach rebase interactive more commands to do better preserve merges Jörg Sommer
2008-04-09 23:58               ` [PATCH/RFC 01/10] Teach rebase interactive the mark command Jörg Sommer
2008-04-09 23:58                 ` [PATCH/RFC 02/10] Teach rebase interactive the reset command Jörg Sommer
2008-04-09 23:58                   ` [PATCH/RFC 03/10] Teach rebase interactive the merge command Jörg Sommer
2008-04-09 23:58                     ` [PATCH/RFC 04/10] Move redo merge code in a function Jörg Sommer
2008-04-09 23:58                       ` [PATCH/RFC 05/10] Rework redo_merge Jörg Sommer
2008-04-09 23:58                         ` [PATCH/RFC 06/10] Unify the lenght of $SHORT* and the commits in the TODO list Jörg Sommer
2008-04-09 23:58                           ` [PATCH/RFC 07/10] fake-editor: output TODO list if unchanged Jörg Sommer
2008-04-09 23:58                             ` [PATCH/RFC 08/10] Don't append default merge message to -m message Jörg Sommer
2008-04-09 23:58                               ` [PATCH/RFC 09/10] Select all lines with fake-editor Jörg Sommer
2008-04-09 23:58                                 ` [PATCH/RFC 10/10] Do rebase with preserve merges with advanced TODO list Jörg Sommer
2008-04-12  0:00                           ` [PATCH/RFC 06/10] Unify the lenght of $SHORT* and the commits in the " Junio C Hamano
2008-04-12  9:13                             ` Jörg Sommer
2008-04-13  6:20                               ` Junio C Hamano
2008-04-13 16:39                                 ` Jörg Sommer
2008-04-14  1:06                                 ` Tarmigan
2008-04-11 23:56                   ` [PATCH/RFC 02/10] Teach rebase interactive the reset command Junio C Hamano
2008-04-12  9:37                     ` Jörg Sommer
2008-04-10  9:33                 ` [PATCH/RFC 01/10] Teach rebase interactive the mark command Mike Ralphson
2008-04-12 10:17                   ` Jörg Sommer
2008-04-11 23:48                 ` Junio C Hamano
2008-04-12 10:11                   ` Jörg Sommer
2008-04-13  3:56                     ` Shawn O. Pearce
2008-04-13 16:50                       ` Jörg Sommer
2008-04-14  6:24                         ` Shawn O. Pearce
2008-04-14  6:54                           ` Junio C Hamano
2008-04-14 10:06                           ` Jörg Sommer
2008-04-14  0:20             ` [PATCH v2 01/13] fake-editor: output TODO list if unchanged Jörg Sommer
2008-04-14  0:20               ` [PATCH v2 02/13] Don't append default merge message to -m message Jörg Sommer
2008-04-14  0:20                 ` [PATCH v2 03/13] Move cleanup code into it's own function Jörg Sommer
2008-04-14  0:21                   ` [PATCH v2 04/13] Teach rebase interactive the mark command Jörg Sommer
2008-04-14  0:21                     ` [PATCH v2 05/13] Teach rebase interactive the reset command Jörg Sommer
2008-04-14  0:21                       ` [PATCH v2 06/13] Move redo merge code in a function Jörg Sommer
2008-04-14  0:21                         ` [PATCH v2 07/13] Teach rebase interactive the merge command Jörg Sommer
2008-04-14  0:21                           ` [PATCH v2 08/13] Unify the lenght of $SHORT* and the commits in the TODO list Jörg Sommer
2008-04-14  0:21                             ` [PATCH v2 09/13] Select all lines with fake-editor Jörg Sommer
2008-04-14  0:21                               ` [PATCH v2 10/13] Do rebase with preserve merges with advanced TODO list Jörg Sommer
2008-04-14  0:21                                 ` [PATCH v2 11/13] Add option --first-parent Jörg Sommer
2008-04-14  0:21                                   ` [PATCH v2 12/13] Teach rebase interactive the tag command Jörg Sommer
2008-04-14  0:21                                     ` [PATCH v2 13/13] Add option --preserve-tags Jörg Sommer
2008-04-22  5:32                     ` [PATCH v2 04/13] Teach rebase interactive the mark command Junio C Hamano
2008-04-22  8:13                       ` Junio C Hamano
2008-04-22  8:52                       ` Johannes Schindelin
2008-04-22  9:55                       ` Jörg Sommer
2008-04-22 10:31                         ` Johannes Schindelin
2008-04-22 16:56                           ` Junio C Hamano
2008-04-22 17:12                             ` Johannes Schindelin
2008-04-29  0:25                               ` Junio C Hamano
2008-04-29  0:39                                 ` Johannes Schindelin
2008-04-29  5:17                                   ` Junio C Hamano
2008-04-29  7:12                                     ` Johannes Sixt
2008-04-29 10:52                                       ` Johannes Schindelin
2008-04-29 21:16                                         ` Junio C Hamano
2008-04-29 21:25                                           ` Johannes Schindelin
2008-04-29 22:23                                             ` Junio C Hamano
2008-04-29 22:55                                               ` Johannes Schindelin
2008-04-29 23:06                                                 ` Junio C Hamano
2008-04-29 23:31                                                   ` Johannes Schindelin
2008-04-30  1:23                                                     ` Junio C Hamano
2008-04-30  6:25                                                       ` Johannes Sixt
2008-04-30  7:10                                                         ` Junio C Hamano
2008-04-30  8:47                                                       ` Johannes Schindelin
2008-04-30  9:19                                                         ` Junio C Hamano
2008-04-30 10:29                                                           ` Johannes Sixt
2008-04-30 11:56                                                           ` Johannes Schindelin
2008-05-01 19:04                                                             ` Junio C Hamano
2008-05-03 12:45                                                               ` Johannes Schindelin
2008-05-03 17:09                                                                 ` Junio C Hamano
2008-05-04  9:38                                                                   ` Johannes Schindelin
2008-05-04 12:52                                                                     ` Jörg Sommer
2008-04-30 13:06                                                         ` Dmitry Potapov
2008-05-01 12:59                                                           ` Johannes Schindelin
2008-04-22 18:04                         ` Junio C Hamano
2008-04-25  9:11                           ` Jörg Sommer
2008-04-25  9:44                             ` [PATCH v2.2] " Jörg Sommer
2008-04-27  6:13                               ` Junio C Hamano
2008-04-27  8:28                                 ` Jörg Sommer
2008-04-14 10:39                   ` [PATCH v2.1] " Jörg Sommer
2008-04-14 23:29                     ` Shawn O. Pearce
2008-04-20 23:44                       ` mark parsing in fast-import Jörg Sommer
2008-04-21  0:26                         ` Shawn O. Pearce
2008-04-21  8:41                           ` Jörg Sommer
2008-04-21 23:59                             ` Shawn O. Pearce
2008-04-22  9:39                               ` Jörg Sommer
2008-04-22 23:15                                 ` Shawn O. Pearce
2008-04-25  9:04                                   ` [PATCH v2] Make mark parsing much more restrictive Jörg Sommer
2008-04-20 16:52                 ` [PATCH v2 02/13] Don't append default merge message to -m message Junio C Hamano
2008-04-21  0:17                   ` Jörg Sommer
2008-04-22  5:27                     ` Junio C Hamano
2008-03-23 22:33     ` [PATCH 3/4] Add a function for get the parents of a commit Johannes Schindelin
2008-03-23 22:29   ` [PATCH 2/4] Rework redo_merge Johannes Schindelin
2008-03-23 22:26 ` [PATCH 1/4] Move redo merge code in a function Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2008-04-13 20:51 [PATCH/RFC 01/10] Teach rebase interactive the mark command Paul Fredrickson
2008-04-14  9:27 ` Jörg Sommer
2008-04-14 14:10 ` Johannes Schindelin
2008-04-15  0:11   ` Junio C Hamano

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).