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

Re: [PATCH v3] t7064: avoid relying on a specific default branch name

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 9, 2020, 10:01 UTC
Message-ID
<nycvar.QRO.7.76.6.2012091059480.25979@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqq360f6hlt.fsf_-_@gitster.c.googlers.com>
Hi Junio,
On Tue, 8 Dec 2020, Junio C Hamano wrote:
Show 22 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> To allow us to consider a change in the default behavior of `git init`
> where it uses a more inclusive name for the initial branch, we must
> first teach the test suite not to rely on a specific default branch
> name. In this patch, we teach t7064 that trick.
>
> To that end, we set a specific name for the initial branch. Ideally, we
> would simply start out by calling `git branch -M initial-branch`, but
> there is a bug in `git branch -M` that does not allow renaming branches
> unless they already have commits. This will be fixed in the
> `js/init-defaultbranch-advice` topic, and until that time, we use the
> equivalent (but less intuitive) `git checkout -f --orphan`.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * v2 used to depend on an older round of a topic that is not in
>    'next' (sj/untracked-files-in-submoduledirectory-is-not-dirty).
>    As the topic stopped touching this test, I rebased the patch on
>    top of 3a0b884c (Tenth batch, 2020-12-02)

Thank you. By doing that, I figure you increased the chances of this patch making it through the integration branches quicker. BTW just for curious lurkers, here is the range-diff:

1:  1d5591c69a5 ! 1:  e8003bfeee7 t7064: avoid relying on a specific default branch name
    @@ t/t7064-wtstatus-pv2.sh: test_expect_success 'untracked changes in added submodu
      		# branch.ab +0 -0
      		1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
      		1 AM S..U 000000 160000 160000 $ZERO_OID $HSUB sub1
    -@@ t/t7064-wtstatus-pv2.sh: test_expect_success 'untracked changes in added submodule (A. S...) (untracked i
    -
    - 		cat >expect <<-EOF &&
    - 		# branch.oid $HSUP
    --		# branch.head master
    --		# branch.upstream origin/master
    -+		# branch.head initial-branch
    -+		# branch.upstream origin/initial-branch
    - 		# branch.ab +0 -0
    - 		1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
    - 		1 A. S... 000000 160000 160000 $ZERO_OID $HSUB sub1
     @@ t/t7064-wtstatus-pv2.sh: test_expect_success 'staged changes in added submodule (AM S.M.)' '
      		cat >expect <<-EOF &&
    @@ t/t7064-wtstatus-pv2.sh: test_expect_success 'staged and untracked changes in ad
      		# branch.ab +0 -0
      		1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
      		1 AM S.MU 000000 160000 160000 $ZERO_OID $HSUB sub1
    -@@ t/t7064-wtstatus-pv2.sh: test_expect_success 'staged and untracked changes in added submodule (AM S.M.) (
    -
    - 		cat >expect <<-EOF &&
    - 		# branch.oid $HSUP
    --		# branch.head master
    --		# branch.upstream origin/master
    -+		# branch.head initial-branch
    -+		# branch.upstream origin/initial-branch
    - 		# branch.ab +0 -0
    - 		1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
    - 		1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
     @@ t/t7064-wtstatus-pv2.sh: test_expect_success 'commit within the submodule appears as new commit in super
      		cat >expect <<-EOF &&

Thanks, Dscho

Previous: Junio C Hamano
Message 4 of 4 in “t7064: avoid relying on a specific default branch name”
  1. t7064: avoid relying on a specific default branch nameJohannes Schindelin via GitGitGadget, Dec 6, 2020
  2. t7064: avoid relying on a specific default branch nameJohannes Schindelin via GitGitGadget, Dec 7, 2020
  3. t7064: avoid relying on a specific default branch nameJunio C Hamano, Dec 8, 2020
  4. Johannes SchindelinDec 9, 2020

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.