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

[PATCH 8/9] pull: update docs & code for option compatibility with rebasing

From
Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 17, 2021, 15:41 UTC
Message-ID
<d1952f014f20d2770c74a311df27f956c8b95e21.1626536508.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1049.git.git.1626536507.gitgitgadget@gmail.com>
From: Elijah Newren <newren@gmail.com>

git-pull.txt includes merge-options.txt, which is written assuming merges will happen. git-pull has allowed rebases for many years; update the documentation to reflect that.

While at it, pass any `--signoff` flag through to the rebase backend too so that we don't have to document it as merge-specific. Rebase has supported the --signoff flag for years now as well.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 Documentation/git-pull.txt      |  2 ++
 Documentation/merge-options.txt | 25 +++++++++++++++++++++++++
 builtin/pull.c                  |  2 ++
 3 files changed, 29 insertions(+)
diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index cad3f6bfcee..6e6e95a7595 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -125,6 +125,8 @@ When false, merge the current branch into the upstream branch.
 +
 When `interactive`, enable the interactive mode of rebase.
 +
+Note that `--ff-only` takes precedence over any `--rebase` flag.
++
 See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
 linkgit:git-config[1] if you want to make `git pull` always use
 `--rebase` instead of merging.
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index eb0aabd396f..3b70abf3c87 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -2,6 +2,9 @@
 --no-commit::
 	Perform the merge and commit the result. This option can
 	be used to override --no-commit.
+ifdef::git-pull[]
+	Only useful when merging.
+endif::git-pull[]
 +
 With --no-commit perform the merge and stop just before creating
 a merge commit, to give the user a chance to inspect and further
@@ -58,6 +61,10 @@ could instead be resolved as a fast-forward.
 +
 With `--ff-only`, resolve the merge as a fast-forward when possible.
 When not possible, refuse to merge and exit with a non-zero status.
+ifdef::git-pull[]
++
+Note that `--no-ff` and `--ff` are ignored when rebasing is requested.
+endif::git-pull[]
 
 -S[<keyid>]::
 --gpg-sign[=<keyid>]::
@@ -73,6 +80,9 @@ When not possible, refuse to merge and exit with a non-zero status.
 	In addition to branch names, populate the log message with
 	one-line descriptions from at most <n> actual commits that are being
 	merged. See also linkgit:git-fmt-merge-msg[1].
+ifdef::git-pull[]
+	Only useful when merging.
+endif::git-pull[]
 +
 With --no-log do not list one-line descriptions from the
 actual commits being merged.
@@ -102,10 +112,17 @@ With --no-squash perform the merge and commit the result. This
 option can be used to override --squash.
 +
 With --squash, --commit is not allowed, and will fail.
+ifdef::git-pull[]
++
+Only useful when merging.
+endif::git-pull[]
 
 --no-verify::
 	This option bypasses the pre-merge and commit-msg hooks.
 	See also linkgit:githooks[5].
+ifdef::git-pull[]
+	Only useful when merging.
+endif::git-pull[]
 
 -s <strategy>::
 --strategy=<strategy>::
@@ -127,6 +144,10 @@ With --squash, --commit is not allowed, and will fail.
 	default trust model, this means the signing key has been signed by
 	a trusted key.  If the tip commit of the side branch is not signed
 	with a valid key, the merge is aborted.
+ifdef::git-pull[]
++
+Only useful when merging.
+endif::git-pull[]
 
 --summary::
 --no-summary::
@@ -166,3 +187,7 @@ endif::git-pull[]
 	projects that started their lives independently. As that is
 	a very rare occasion, no configuration variable to enable
 	this by default exists and will not be added.
+ifdef::git-pull[]
++
+Only useful when merging.
+endif::git-pull[]
diff --git a/builtin/pull.c b/builtin/pull.c
index 2d7f2d765ab..3a61b92f328 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -893,6 +893,8 @@ static int run_rebase(const struct object_id *newbase,
 	strvec_pushv(&args, opt_strategy_opts.v);
 	if (opt_gpg_sign)
 		strvec_push(&args, opt_gpg_sign);
+	if (opt_signoff)
+		strvec_push(&args, opt_signoff);
 	if (opt_autostash == 0)
 		strvec_push(&args, "--no-autostash");
 	else if (opt_autostash == 1)
-- 
gitgitgadget
Previous: Felipe ContrerasNext: Junio C Hamano
Message 24 of 59 in “Handle pull option precedence”
  1. 0/9 Handle pull option precedenceElijah Newren via GitGitGadget, Jul 17, 2021
  2. 2/9 t7601: add tests of interactions with multiple merge heads and configElijah Newren via GitGitGadget, Jul 17, 2021
  3. Felipe ContrerasJul 17, 2021
  4. Junio C HamanoJul 20, 2021
  5. Elijah NewrenJul 21, 2021
  6. 1/9 t7601: add relative precedence tests for merge and rebase flags/optionsElijah Newren via GitGitGadget, Jul 17, 2021
  7. Felipe ContrerasJul 17, 2021
  8. Junio C HamanoJul 19, 2021
  9. Elijah NewrenJul 20, 2021
  10. Junio C HamanoJul 20, 2021
  11. Felipe ContrerasJul 20, 2021
  12. 3/9 pull: abort if --ff-only is given and fast-forwarding is impossibleAlex Henrie via GitGitGadget, Jul 17, 2021
  13. Felipe ContrerasJul 17, 2021
  14. 4/9 pull: since --ff-only overrides, handle it firstElijah Newren via GitGitGadget, Jul 17, 2021
  15. Felipe ContrerasJul 17, 2021
  16. 5/9 pull: ensure --rebase overrides ability to ffElijah Newren via GitGitGadget, Jul 17, 2021
  17. Felipe ContrerasJul 17, 2021
  18. Junio C HamanoJul 20, 2021
  19. Elijah NewrenJul 21, 2021
  20. 6/9 pull: make --rebase and --no-rebase override pull.ff=onlyElijah Newren via GitGitGadget, Jul 17, 2021
  21. Felipe ContrerasJul 17, 2021
  22. Junio C HamanoJul 20, 2021
  23. Felipe ContrerasJul 21, 2021
  24. 8/9 pull: update docs & code for option compatibility with rebasingElijah Newren via GitGitGadget, Jul 17, 2021
  25. Junio C HamanoJul 21, 2021
  26. Elijah NewrenJul 21, 2021
  27. Junio C HamanoJul 21, 2021
  28. 7/9 pull: abort by default when fast-forwarding is not possibleElijah Newren via GitGitGadget, Jul 17, 2021
  29. Felipe ContrerasJul 17, 2021
  30. 9/9 pull: fix handling of multiple headsElijah Newren via GitGitGadget, Jul 17, 2021
  31. Felipe ContrerasJul 17, 2021
  32. 0/8 Handle pull option precedenceElijah Newren via GitGitGadget, Jul 21, 2021
  33. 3/8 pull: abort if --ff-only is given and fast-forwarding is impossibleAlex Henrie via GitGitGadget, Jul 21, 2021
  34. Felipe ContrerasJul 21, 2021
  35. 1/8 t7601: test interaction of merge/rebase/fast-forward flags and optionsElijah Newren via GitGitGadget, Jul 21, 2021
  36. Felipe ContrerasJul 21, 2021
  37. 2/8 t7601: add tests of interactions with multiple merge heads and configElijah Newren via GitGitGadget, Jul 21, 2021
  38. 5/8 pull: make --rebase and --no-rebase override pull.ff=onlyElijah Newren via GitGitGadget, Jul 21, 2021
  39. Felipe ContrerasJul 21, 2021
  40. 8/8 pull: fix handling of multiple headsElijah Newren via GitGitGadget, Jul 21, 2021
  41. 7/8 pull: update docs & code for option compatibility with rebasingElijah Newren via GitGitGadget, Jul 21, 2021
  42. 6/8 pull: abort by default when fast-forwarding is not possibleElijah Newren via GitGitGadget, Jul 21, 2021
  43. Felipe ContrerasJul 21, 2021
  44. 4/8 pull: since --ff-only overrides, handle it firstElijah Newren via GitGitGadget, Jul 21, 2021
  45. Matthias BaumgartenJul 21, 2021
  46. Felipe ContrerasJul 21, 2021
  47. Junio C HamanoJul 21, 2021
  48. Elijah NewrenJul 22, 2021
  49. Felipe ContrerasJul 21, 2021
  50. 0/8 Handle pull option precedenceElijah Newren via GitGitGadget, Jul 22, 2021
  51. 1/8 t7601: test interaction of merge/rebase/fast-forward flags and optionsElijah Newren via GitGitGadget, Jul 22, 2021
  52. 2/8 t7601: add tests of interactions with multiple merge heads and configElijah Newren via GitGitGadget, Jul 22, 2021
  53. 3/8 pull: abort if --ff-only is given and fast-forwarding is impossibleAlex Henrie via GitGitGadget, Jul 22, 2021
  54. 5/8 pull: make --rebase and --no-rebase override pull.ff=onlyElijah Newren via GitGitGadget, Jul 22, 2021
  55. 4/8 pull: since --ff-only overrides, handle it firstElijah Newren via GitGitGadget, Jul 22, 2021
  56. 6/8 pull: abort by default when fast-forwarding is not possibleElijah Newren via GitGitGadget, Jul 22, 2021
  57. 8/8 pull: fix handling of multiple headsElijah Newren via GitGitGadget, Jul 22, 2021
  58. 7/8 pull: update docs & code for option compatibility with rebasingElijah Newren via GitGitGadget, Jul 22, 2021
  59. Felipe ContrerasJul 22, 2021

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.