git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Christian Biesinger <cbiesinger@google.com>,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: [PATCH v2 0/5] rebase: fix breakage with `format.useAutoBase`
Date: Wed, 27 Nov 2019 10:13:36 -0800	[thread overview]
Message-ID: <cover.1574878089.git.liu.denton@gmail.com> (raw)
In-Reply-To: <cover.1574820308.git.liu.denton@gmail.com>

Apparently, this use case has been broken for a long time... Since
bb52995f3e (format-patch: introduce format.useAutoBase configuration,
2016-04-26). I'm surprised it's only been reported now.

This patchset fixes the breakage by teaching
`git format-patch --no-base` and making rebase use it.

Changes since v1:

* Update some log messages

Denton Liu (5):
  t3400: demonstrate failure with format.useAutoBase
  format-patch: fix indentation
  t4014: use test_config()
  format-patch: teach --no-base
  rebase: fix format.useAutoBase breakage

 Documentation/git-format-patch.txt |  5 +++--
 builtin/log.c                      | 26 ++++++++++++++++++++++----
 builtin/rebase.c                   |  3 ++-
 t/t3400-rebase.sh                  |  6 ++++++
 t/t4014-format-patch.sh            | 14 +++++++++-----
 5 files changed, 42 insertions(+), 12 deletions(-)

Range-diff against v1:
1:  a1741e5434 ! 1:  4089e51041 t3400: demonstrate failure with format.useAutoBase
    @@ Commit message
     
         Ever since bb52995f3e (format-patch: introduce format.useAutoBase
         configuration, 2016-04-26), `git rebase` has been broken when
    -    `format.useAutoBase = true`. Demonstrate that failure here.
    +    `format.useAutoBase = true`. It fails when rebasing a branch that
    +    doesn't have an upstream set:
    +
    +            fatal: failed to get upstream, if you want to record base commit automatically,
    +            please use git branch --set-upstream-to to track a remote branch.
    +            Or you could specify base commit by --base=<base-commit-id> manually
    +            error:
    +            git encountered an error while preparing the patches to replay
    +            these revisions:
    +
    +                ede2467cdedc63784887b587a61c36b7850ebfac..d8f581194799ae29bf5fa72a98cbae98a1198b12
    +
    +            As a result, git cannot rebase them.
    +
    +    Demonstrate that failure here.
     
         Reported-by: Christian Biesinger <cbiesinger@google.com>
     
2:  46fd4113aa = 2:  d288d6c3a5 format-patch: fix indentation
3:  22b1fb14f9 ! 3:  196b5d8dbc t4014: use `test_config`
    @@ Metadata
     Author: Denton Liu <liu.denton@gmail.com>
     
      ## Commit message ##
    -    t4014: use `test_config`
    +    t4014: use test_config()
     
         Instead of manually unsetting the config after the test case is done,
    -    use `test_config` to do it automatically. While we're at it, fix a typo
    +    use test_config() to do it automatically. While we're at it, fix a typo
         in a test case name.
     
      ## t/t4014-format-patch.sh ##
4:  e072c36e6a = 4:  f7e5325cc0 format-patch: teach --no-base
5:  15e6ccb203 ! 5:  62c59c12e3 rebase: fix `format.useAutoBase` breakage
    @@ Metadata
     Author: Denton Liu <liu.denton@gmail.com>
     
      ## Commit message ##
    -    rebase: fix `format.useAutoBase` breakage
    +    rebase: fix format.useAutoBase breakage
     
         With `format.useAutoBase = true`, running rebase resulted in an
    -    error when an upstream was't set:
    +    error when an upstream wasn't set:
     
                 fatal: failed to get upstream, if you want to record base commit automatically,
                 please use git branch --set-upstream-to to track a remote branch.
-- 
2.24.0.504.g3cd56eb17d


  parent reply	other threads:[~2019-11-27 18:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 20:50 Bug with "git rebase" when format.useAutoBase is set Christian Biesinger
2019-11-27  2:09 ` [PATCH 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-11-27  2:09   ` [PATCH 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-11-27  2:26     ` Eric Sunshine
2019-11-30 17:25       ` Junio C Hamano
2019-11-27  2:09   ` [PATCH 2/5] format-patch: fix indentation Denton Liu
2019-11-27  2:09   ` [PATCH 3/5] t4014: use `test_config` Denton Liu
2019-11-27  2:09   ` [PATCH 4/5] format-patch: teach --no-base Denton Liu
2019-11-27  2:09   ` [PATCH 5/5] rebase: fix `format.useAutoBase` breakage Denton Liu
2019-11-27  2:42     ` Eric Sunshine
2019-11-27 17:14   ` [PATCH 0/5] rebase: fix breakage with `format.useAutoBase` Christian Biesinger
2019-11-27 18:13   ` Denton Liu [this message]
2019-11-27 18:13     ` [PATCH v2 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-11-27 18:13     ` [PATCH v2 2/5] format-patch: fix indentation Denton Liu
2019-11-27 18:13     ` [PATCH v2 3/5] t4014: use test_config() Denton Liu
2019-11-27 18:13     ` [PATCH v2 4/5] format-patch: teach --no-base Denton Liu
2019-11-27 19:56       ` Denton Liu
2019-11-27 18:13     ` [PATCH v2 5/5] rebase: fix format.useAutoBase breakage Denton Liu
2019-12-04 16:21       ` Christian Biesinger
2019-12-04  7:47     ` [PATCH v3 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-12-04  7:47       ` [PATCH v3 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-12-04  7:47       ` [PATCH v3 2/5] format-patch: fix indentation Denton Liu
2019-12-04  7:47       ` [PATCH v3 3/5] t4014: use test_config() Denton Liu
2019-12-04  7:47       ` [PATCH v3 4/5] format-patch: teach --no-base Denton Liu
2019-12-04 10:36         ` René Scharfe
2019-12-04 17:26           ` Junio C Hamano
2019-12-04  7:48       ` [PATCH v3 5/5] rebase: fix format.useAutoBase breakage Denton Liu
2019-12-04 21:24       ` [PATCH v4 0/5] rebase: fix breakage with `format.useAutoBase` Denton Liu
2019-12-04 21:24         ` [PATCH v4 1/5] t3400: demonstrate failure with format.useAutoBase Denton Liu
2019-12-04 21:24         ` [PATCH v4 2/5] format-patch: fix indentation Denton Liu
2019-12-04 21:25         ` [PATCH v4 3/5] t4014: use test_config() Denton Liu
2019-12-04 21:25         ` [PATCH v4 4/5] format-patch: teach --no-base Denton Liu
2019-12-04 21:25         ` [PATCH v4 5/5] rebase: fix format.useAutoBase breakage Denton Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1574878089.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=cbiesinger@google.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).