Skip to content

builtin rebase options

Johannes Schindelin via GitGitGadget git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest18 patches 3 repliesIn review

Changes in v2 from the cover letter

* Added the forgotten -k short option for --keep-empty (and verified that no other short options were forgotten).
* The "Applied autostash" message is now translated (as was the original in the shell script version).

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18builtin rebase: allow selecting the rebase "backend"builtin/rebase.c+37 -00 replies
2/18builtin rebase: support --signoffbuiltin/rebase.c+17 -00 replies
3/18builtin rebase: support --rerere-autoupdatebuiltin/rebase.c+25 -00 replies
4/18builtin rebase: support --committer-date-is-author-datebuiltin/rebase.c+10 -00 replies
5/18builtin rebase: support `ignore-whitespace` optionbuiltin/rebase.c+6 -00 replies
6/18builtin rebase: support `ignore-date` optionbuiltin/rebase.c+8 -00 replies
7/18builtin rebase: support `keep-empty` optionbuiltin/rebase.c+24 -00 replies
8/18builtin rebase: support `--autosquash`builtin/rebase.c+10 -00 replies
9/18builtin rebase: support `--gpg-sign` optionbuiltin/rebase.c+27 -00 replies
10/18builtin rebase: support `-C` and `--whitespace=<type>`builtin/rebase.c+23 -00 replies
11/18builtin rebase: support `--autostash` optionbuiltin/rebase.c+109 -80 replies
12/18builtin rebase: support `--exec`builtin/rebase.c+18 -00 replies
13/18builtin rebase: support `--allow-empty-message` optionbuiltin/rebase.c+7 -00 replies
14/18builtin rebase: support --rebase-merges[=[no-]rebase-cousins]builtin/rebase.c+21 -00 replies
15/18merge-base --fork-point: extract libified functionbuiltin/merge-base.c commit.c commit.h+89 -750 replies
16/18builtin rebase: support `fork-point` optionbuiltin/rebase.c+11 -00 replies
17/18builtin rebase: add support for custom merge strategiesbuiltin/rebase.c+57 -00 replies
18/18builtin rebase: support --rootbuiltin/rebase.c+29 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 00/18] builtin rebase options

This patch series completes the support for all rebase options in the builtin rebase, e.g. --signoff, rerere-autoupdate, etc.

It is based on pk/rebase -in-c-3-acts.

Changes since v1:

* Added the forgotten -k short option for --keep-empty (and verified that no other short options were forgotten).
* The "Applied autostash" message is now translated (as was the original in the shell script version).

Pratik Karki (18):
builtin rebase: allow selecting the rebase "backend" builtin rebase: support --signoff
builtin rebase: support --rerere-autoupdate
builtin rebase: support --committer-date-is-author-date builtin rebase: support ignore-whitespace option builtin rebase: support ignore-date option builtin rebase: support keep-empty option
builtin rebase: support --autosquash
builtin rebase: support --gpg-sign option
builtin rebase: support -C and --whitespace=<type> builtin rebase: support --autostash option builtin rebase: support --exec
builtin rebase: support --allow-empty-message option builtin rebase: support --rebase-merges[=[no-]rebase-cousins] merge-base --fork-point: extract libified function builtin rebase: support fork-point option
builtin rebase: add support for custom merge strategies builtin rebase: support --root

 builtin/merge-base.c |  81 +-------
 builtin/rebase.c     | 449 ++++++++++++++++++++++++++++++++++++++++++-
 commit.c             |  81 ++++++++
 commit.h             |   2 +
 4 files changed, 528 insertions(+), 85 deletions(-)

base-commit: e01f72be63e6cb58243124abb2491f9d5dbcdbef
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-33%2Fdscho%2Frebase-in-c-4-opts-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-33/dscho/rebase-in-c-4-opts-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/33

Range-diff vs v1:

1: 22a65191f8 ! 1: 7f751c6ce1 builtin rebase: allow selecting the rebase "backend"
@@ -19,6 +19,7 @@
tests for this via git pull --rebase=preserve).

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c --- a/builtin/rebase.c
2: cb9129890b ! 2: 1e2ce4b34e builtin rebase: support --signoff
@@ -7,6 +7,7 @@
handling is left to the rebase backends.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
3: 99ff1fc128 ! 3: a301ef6bbd builtin rebase: support --rerere-autoupdate

     @@ -7,6 +7,7 @@
          `git-legacy-rebase.sh`.
      
          Signed-off-by: Pratik Karki <[email protected]>
     +    Signed-off-by: Johannes Schindelin <[email protected]>
      
      diff --git a/builtin/rebase.c b/builtin/rebase.c
      --- a/builtin/rebase.c

4: cb6596ea93 ! 4: 8f67a3969d builtin rebase: support --committer-date-is-author-date
@@ -6,6 +6,7 @@
git_am_opt variable that is handled by the git-rebase--am backend.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
5: bf3279c2d5 ! 5: f04394a500 builtin rebase: support ignore-whitespace option

     @@ -7,6 +7,7 @@
          `--am` backend.
      
          Signed-off-by: Pratik Karki <[email protected]>
     +    Signed-off-by: Johannes Schindelin <[email protected]>
      
      diff --git a/builtin/rebase.c b/builtin/rebase.c
      --- a/builtin/rebase.c

6: 804e1969c2 ! 6: 83bb277509 builtin rebase: support ignore-date option
@@ -6,6 +6,7 @@
to easily change the dates of the rebased commits.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
7: fcf2243476 ! 7: a8f12bf01f builtin rebase: support keep-empty option

     @@ -12,6 +12,7 @@
          already be chosen during the `parse_options()` call.
      
          Signed-off-by: Pratik Karki <[email protected]>
     +    Signed-off-by: Johannes Schindelin <[email protected]>
      
      diff --git a/builtin/rebase.c b/builtin/rebase.c
      --- a/builtin/rebase.c
     @@ -60,7 +61,7 @@
       			 &options.allow_rerere_autoupdate,
       			 N_("allow rerere to update index  with resolved "
       			    "conflict")),
     -+		OPT_BOOL(0, "keep-empty", &options.keep_empty,
     ++		OPT_BOOL('k', "keep-empty", &options.keep_empty,
      +			 N_("preserve empty commits during rebase")),
       		OPT_END(),
       	};

8: b4ecffc8f1 ! 8: 1b6851e5e1 builtin rebase: support --autosquash
@@ -12,6 +12,7 @@
falls back to) git_default_config().

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c --- a/builtin/rebase.c
@@ -46,7 +47,7 @@

@@
"conflict")),
- OPT_BOOL(0, "keep-empty", &options.keep_empty,
+ OPT_BOOL('k', "keep-empty", &options.keep_empty,
N_("preserve empty commits during rebase")),
+ OPT_BOOL(0, "autosquash", &options.autosquash,
+ N_("move commits that begin with "
9: e2a26f10e5 ! 9: b8055fb258 builtin rebase: support --gpg-sign option
@@ -6,6 +6,7 @@
to GPG-sign commits.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
10: a1f3245250 ! 10: 98908573ce builtin rebase: support -C and --whitespace=<type>
@@ -8,6 +8,7 @@
shell script version does so, too.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
11: 7b3c0dbbd9 ! 11: 5e5e5cb758 builtin rebase: support --autostash option

     @@ -11,6 +11,7 @@
          builtin.
      
          Signed-off-by: Pratik Karki <[email protected]>
     +    Signed-off-by: Johannes Schindelin <[email protected]>
      
      diff --git a/builtin/rebase.c b/builtin/rebase.c
      --- a/builtin/rebase.c
     @@ -57,7 +58,7 @@
      +	stash_apply.no_stderr = stash_apply.no_stdout =
      +		stash_apply.no_stdin = 1;
      +	if (!run_command(&stash_apply))
     -+		printf("Applied autostash.\n");
     ++		printf(_("Applied autostash.\n"));
      +	else {
      +		struct argv_array args = ARGV_ARRAY_INIT;
      +		int res = 0;

12: 6f6b3d9339 ! 12: 01e5cb3e91 builtin rebase: support --exec
@@ -14,6 +14,7 @@
The --exec option requires --interactive machinery.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
13: fa643c4b3f ! 13: 1c723ad592 builtin rebase: support --allow-empty-message option
@@ -14,6 +14,7 @@
git rebase, therefore the builtin rebase does the same.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
14: 00d7ccd356 ! 14: 1bebcde41c builtin rebase: support --rebase-merges[=[no-]rebase-cousins]

     @@ -6,6 +6,7 @@
          rebase, too.
      
          Signed-off-by: Pratik Karki <[email protected]>
     +    Signed-off-by: Johannes Schindelin <[email protected]>
      
      diff --git a/builtin/rebase.c b/builtin/rebase.c
      --- a/builtin/rebase.c

15: 1cf16f416e ! 15: 05652bccfe merge-base --fork-point: extract libified function
@@ -12,6 +12,7 @@
process definitely did not traverse any commits before exiting.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/merge-base.c b/builtin/merge-base.c --- a/builtin/merge-base.c
16: 78ffb7aaff ! 16: 25f6771947 builtin rebase: support fork-point option
@@ -6,6 +6,7 @@
This is converted as-is from git-legacy-rebase.sh.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c
--- a/builtin/rebase.c
17: 693b662542 ! 17: 10dc87d4ff builtin rebase: add support for custom merge strategies
@@ -9,6 +9,7 @@
This commit adds that support to the builtin rebase.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c --- a/builtin/rebase.c
18: 95679ccf0b ! 18: f155141023 builtin rebase: support --root
@@ -9,6 +9,7 @@
the fact that we do not have to write an empty tree in C.

+ Signed-off-by: Johannes Schindelin <[email protected]>

diff --git a/builtin/rebase.c b/builtin/rebase.c --- a/builtin/rebase.c

Signature · 1 line
gitgitgadget