All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags}
@ 2011-06-27  0:16 Greg Price
  2009-10-10  2:52 ` [PATCH 1/6] rebase -i: Add the "ref" command Greg Price
                   ` (7 more replies)
  0 siblings, 8 replies; 24+ messages in thread
From: Greg Price @ 2011-06-27  0:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

This series adds a "ref" command to rebase -i, and options
--rewrite-{refs,heads,tags} to generate "ref" commands in the original
TODO file.  This makes it easy to rebase a branch together with
intermediate markers, or a series of branches.

For example, in this situation:

      part1 part2 topic
        |     |     |
        v     v     v
  A--*--*--*--*--*--*
   \
    B <--master

we may want to rebase 'topic' onto the new master, rewriting the
intermediate branches 'part1', 'part2' to the corresponding new
commits.  This can be done with a sequence of "git rebase --onto"
commands, but it's tricky to get right.

With this series, the command
  $ git rebase --rewrite-heads master topic
suffices to produce this result:

        part1 part2 topic
  A       |     |     |
   \      v     v     v
    B--*--*--*--*--*--*
    ^
    |
    master


I originally submitted a version of this series nearly a year and a
half ago [1].  This version has been rebased to the new release 1.7.6
(Martin von Zweigbergk's cleanups gave me quite some conflicts to
resolve, but are nevertheless much appreciated!) and the interface has
been adjusted for the comments of Junio and others [2].  The general
command is --rewrite-refs=PATTERN; --rewrite-heads and --rewrite-tags
are provided as shortcuts, the former being equivalent to the --refs
of my original proposal.

 [1]  http://www.amailbox.net/mailarchive/git/2009/12/22/18967
 [2]  http://www.amailbox.net/mailarchive/git/2009/12/22/18972

I have no excuse for the year and a half of delay in submitting the
revised version, but I believe that late is better than never. =)


The series contains two preparatory patches that are independently useful:
  pretty: Add %D for script-friendly decoration
  for-each-ref: --stdin to match specified refs against pattern
Each one exposes a bit more knowledge of the repository in a
machine-readable form convenient for scripting.  I hope other people
may find them useful in writing other scripts.

Greg


---
Greg Price (6):
  rebase -i: Add the "ref" command
  pretty: Add %D for script-friendly decoration
  for-each-ref: --stdin to match specified refs against pattern
  rebase: --rewrite-{refs,heads,tags} to pull refs along with branch
  t/lib-rebase.sh: pass through ref commands
  rebase --rewrite-refs: tests

 Documentation/git-rebase.txt     |   15 ++++++++
 Documentation/pretty-formats.txt |    1 +
 builtin/for-each-ref.c           |   22 ++++++++++-
 git-rebase--interactive.sh       |   37 ++++++++++++++++++-
 git-rebase.sh                    |   28 ++++++++++++++
 pretty.c                         |   33 +++++++++++++----
 t/lib-rebase.sh                  |    2 +-
 t/t3420-rebase-ref.sh            |   75 ++++++++++++++++++++++++++++++++++++++
 8 files changed, 201 insertions(+), 12 deletions(-)
 create mode 100644 t/t3420-rebase-ref.sh

-- 
1.7.5.4

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

end of thread, other threads:[~2011-08-03 22:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-27  0:16 [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags} Greg Price
2009-10-10  2:52 ` [PATCH 1/6] rebase -i: Add the "ref" command Greg Price
2011-06-27 18:46   ` Junio C Hamano
2011-06-28 11:15     ` Greg Price
2009-11-18 23:22 ` [PATCH 2/6] pretty: Add %D for script-friendly decoration Greg Price
2011-06-27 19:07   ` Junio C Hamano
2009-11-18 23:51 ` [PATCH 4/6] rebase: --rewrite-{refs,heads,tags} to pull refs along with branch Greg Price
2011-06-27 16:11   ` Phil Hord
2011-06-28 11:19     ` Greg Price
2010-01-07 23:08 ` [PATCH 3/6] for-each-ref: --stdin to match specified refs against pattern Greg Price
2010-01-25  2:26 ` [PATCH 5/6] t/lib-rebase.sh: pass through ref commands Greg Price
2010-01-25  2:28 ` [PATCH 6/6] rebase --rewrite-refs: tests Greg Price
2011-06-27 16:07   ` Phil Hord
2011-06-28 11:22     ` Greg Price
2011-06-27 21:02   ` Junio C Hamano
2011-06-28 11:20     ` Greg Price
2011-06-27 18:36 ` [PATCH 0/6] rebase: command "ref" and options --rewrite-{refs,heads,tags} Junio C Hamano
     [not found]   ` <BANLkTinDFYsw7-N=_Ex8i42So_0LzVAWvA@mail.gmail.com>
2011-06-28 10:47     ` Fwd: " Greg Price
2011-06-28 13:17       ` Greg Price
2011-06-30  4:25         ` Ramkumar Ramachandra
2011-08-03 13:32       ` Fwd: " Sverre Rabbelier
2011-08-03 22:31         ` Greg Price
2011-06-27 21:23 ` Junio C Hamano
     [not found]   ` <BANLkTi=Akib+7R7D2GEwV8dOTQ1vsqgfxA@mail.gmail.com>
2011-06-28 10:56     ` Fwd: " Greg Price

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.