git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] t2106 vs. the default branch name
@ 2020-11-18 14:49 Johannes Schindelin via GitGitGadget
  2020-11-18 14:49 ` [PATCH 1/3] t2106: adjust style to the current conventions Johannes Schindelin via GitGitGadget
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 14:49 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin

Yet another thing I noticed while working on 
https://github.com/gitgitgadget/git/pull/762.

Johannes Schindelin (3):
  t2106: adjust style to the current conventions
  t2106: make test independent of the current main branch name
  t2106: ensure that the checkout fails for the expected reason

 t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------
 1 file changed, 17 insertions(+), 14 deletions(-)


base-commit: e31aba42fb12bdeb0f850829e008e1e3f43af500
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-792%2Fdscho%2Ft2106-and-default-branch-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-792/dscho/t2106-and-default-branch-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/792
-- 
gitgitgadget

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

* [PATCH 1/3] t2106: adjust style to the current conventions
  2020-11-18 14:49 [PATCH 0/3] t2106 vs. the default branch name Johannes Schindelin via GitGitGadget
@ 2020-11-18 14:49 ` Johannes Schindelin via GitGitGadget
  2020-11-18 14:49 ` [PATCH 2/3] t2106: make test independent of the current main branch name Johannes Schindelin via GitGitGadget
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 14:49 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We settled on the style where the test cases' code starts by the opening
single quote being on the `test_expect_*` line, and the closing quote
being in its own line after the code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2106-update-index-assume-unchanged.sh | 30 +++++++++++++-----------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 99d858c6b7..ff0947f388 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -5,20 +5,22 @@ test_description='git update-index --assume-unchanged test.
 
 . ./test-lib.sh
 
-test_expect_success 'setup' \
-	': >file &&
-	 git add file &&
-	 git commit -m initial &&
-	 git branch other &&
-	 echo upstream >file &&
-	 git add file &&
-	 git commit -m upstream'
+test_expect_success 'setup' '
+	: >file &&
+	git add file &&
+	git commit -m initial &&
+	git branch other &&
+	echo upstream >file &&
+	git add file &&
+	git commit -m upstream
+'
 
-test_expect_success 'do not switch branches with dirty file' \
-	'git reset --hard &&
-	 git checkout other &&
-	 echo dirt >file &&
-	 git update-index --assume-unchanged file &&
-	 test_must_fail git checkout master'
+test_expect_success 'do not switch branches with dirty file' '
+	git reset --hard &&
+	git checkout other &&
+	echo dirt >file &&
+	git update-index --assume-unchanged file &&
+	test_must_fail git checkout master
+'
 
 test_done
-- 
gitgitgadget


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

* [PATCH 2/3] t2106: make test independent of the current main branch name
  2020-11-18 14:49 [PATCH 0/3] t2106 vs. the default branch name Johannes Schindelin via GitGitGadget
  2020-11-18 14:49 ` [PATCH 1/3] t2106: adjust style to the current conventions Johannes Schindelin via GitGitGadget
@ 2020-11-18 14:49 ` Johannes Schindelin via GitGitGadget
  2020-11-18 18:26   ` Junio C Hamano
  2020-11-18 14:49 ` [PATCH 3/3] t2106: ensure that the checkout fails for the expected reason Johannes Schindelin via GitGitGadget
  2020-11-18 20:46 ` [PATCH 0/3] t2106 vs. the default branch name Junio C Hamano
  3 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 14:49 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

We do have this wonderful shortcut `git checkout -` to go back to the
previous branch, thanks to the reflog.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2106-update-index-assume-unchanged.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index ff0947f388..3396f23363 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -20,7 +20,7 @@ test_expect_success 'do not switch branches with dirty file' '
 	git checkout other &&
 	echo dirt >file &&
 	git update-index --assume-unchanged file &&
-	test_must_fail git checkout master
+	test_must_fail git checkout -
 '
 
 test_done
-- 
gitgitgadget


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

* [PATCH 3/3] t2106: ensure that the checkout fails for the expected reason
  2020-11-18 14:49 [PATCH 0/3] t2106 vs. the default branch name Johannes Schindelin via GitGitGadget
  2020-11-18 14:49 ` [PATCH 1/3] t2106: adjust style to the current conventions Johannes Schindelin via GitGitGadget
  2020-11-18 14:49 ` [PATCH 2/3] t2106: make test independent of the current main branch name Johannes Schindelin via GitGitGadget
@ 2020-11-18 14:49 ` Johannes Schindelin via GitGitGadget
  2020-11-18 20:46 ` [PATCH 0/3] t2106 vs. the default branch name Junio C Hamano
  3 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin via GitGitGadget @ 2020-11-18 14:49 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <johannes.schindelin@gmx.de>

During the transition of the test suite to a new default branch name, it
was noticed that this test case succeeded for the wrong reason when the
default branch name was overridden.

While we fixed that in the previous commit, let's make sure that we look
for a tell-tale in the error message that the `git checkout` failed for
the reason we wanted it to fail.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 t/t2106-update-index-assume-unchanged.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
index 3396f23363..2d450daf5c 100755
--- a/t/t2106-update-index-assume-unchanged.sh
+++ b/t/t2106-update-index-assume-unchanged.sh
@@ -20,7 +20,8 @@ test_expect_success 'do not switch branches with dirty file' '
 	git checkout other &&
 	echo dirt >file &&
 	git update-index --assume-unchanged file &&
-	test_must_fail git checkout -
+	test_must_fail git checkout - 2>err &&
+	test_i18ngrep overwritten err
 '
 
 test_done
-- 
gitgitgadget

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

* Re: [PATCH 2/3] t2106: make test independent of the current main branch name
  2020-11-18 14:49 ` [PATCH 2/3] t2106: make test independent of the current main branch name Johannes Schindelin via GitGitGadget
@ 2020-11-18 18:26   ` Junio C Hamano
  0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2020-11-18 18:26 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> We do have this wonderful shortcut `git checkout -` to go back to the
> previous branch, thanks to the reflog.

;-)

>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  t/t2106-update-index-assume-unchanged.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t2106-update-index-assume-unchanged.sh b/t/t2106-update-index-assume-unchanged.sh
> index ff0947f388..3396f23363 100755
> --- a/t/t2106-update-index-assume-unchanged.sh
> +++ b/t/t2106-update-index-assume-unchanged.sh
> @@ -20,7 +20,7 @@ test_expect_success 'do not switch branches with dirty file' '
>  	git checkout other &&
>  	echo dirt >file &&
>  	git update-index --assume-unchanged file &&
> -	test_must_fail git checkout master
> +	test_must_fail git checkout -
>  '
>  
>  test_done

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

* Re: [PATCH 0/3] t2106 vs. the default branch name
  2020-11-18 14:49 [PATCH 0/3] t2106 vs. the default branch name Johannes Schindelin via GitGitGadget
                   ` (2 preceding siblings ...)
  2020-11-18 14:49 ` [PATCH 3/3] t2106: ensure that the checkout fails for the expected reason Johannes Schindelin via GitGitGadget
@ 2020-11-18 20:46 ` Junio C Hamano
  2020-11-18 20:56   ` Johannes Schindelin
  3 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2020-11-18 20:46 UTC (permalink / raw)
  To: Johannes Schindelin via GitGitGadget; +Cc: git, Johannes Schindelin

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> Yet another thing I noticed while working on 
> https://github.com/gitgitgadget/git/pull/762.
>
> Johannes Schindelin (3):
>   t2106: adjust style to the current conventions
>   t2106: make test independent of the current main branch name
>   t2106: ensure that the checkout fails for the expected reason
>
>  t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------
>  1 file changed, 17 insertions(+), 14 deletions(-)

This seems to partly replicate and partly deprecate what is in that
final stretch 27-or-28 patch series does to the same test script.
Are we taking this and then removing a patch or two from that larger
series?

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

* Re: [PATCH 0/3] t2106 vs. the default branch name
  2020-11-18 20:46 ` [PATCH 0/3] t2106 vs. the default branch name Junio C Hamano
@ 2020-11-18 20:56   ` Johannes Schindelin
  2020-11-18 21:53     ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Schindelin @ 2020-11-18 20:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Junio,

On Wed, 18 Nov 2020, Junio C Hamano wrote:

> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > Yet another thing I noticed while working on
> > https://github.com/gitgitgadget/git/pull/762.
> >
> > Johannes Schindelin (3):
> >   t2106: adjust style to the current conventions
> >   t2106: make test independent of the current main branch name
> >   t2106: ensure that the checkout fails for the expected reason
> >
> >  t/t2106-update-index-assume-unchanged.sh | 31 +++++++++++++-----------
> >  1 file changed, 17 insertions(+), 14 deletions(-)
>
> This seems to partly replicate and partly deprecate what is in that
> final stretch 27-or-28 patch series does to the same test script.
> Are we taking this and then removing a patch or two from that larger
> series?

Sorry, I meant to explain my current thinking: for v3, I want to
accommodate your wish (to mark every test script with the hard-coded
default branch name individually, and only those test scripts that
actually need to hard-code it). It is not only to fulfill your wish, I got
genuinely curious what would actually be needed to make that happen.

The four test scripts for which I sent patch series in the past hours to
remove the use of the name `master` won't be touched by v3 of this here
patch series at all (because it won't be necessary anymore).

Ciao,
Dscho

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

* Re: [PATCH 0/3] t2106 vs. the default branch name
  2020-11-18 20:56   ` Johannes Schindelin
@ 2020-11-18 21:53     ` Junio C Hamano
  2020-11-18 22:25       ` Johannes Schindelin
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2020-11-18 21:53 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Johannes Schindelin via GitGitGadget, git

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:


> The four test scripts for which I sent patch series in the past hours to
> remove the use of the name `master` won't be touched by v3 of this here
> patch series at all (because it won't be necessary anymore).

Ah, OK.  I somehow had an impression that the big series was more or
less done but rethinking the structure and ejecting these changes to
tests that do not care what name the "init" uses by default from the
series makes a lot of sense.

Thanks.

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

* Re: [PATCH 0/3] t2106 vs. the default branch name
  2020-11-18 21:53     ` Junio C Hamano
@ 2020-11-18 22:25       ` Johannes Schindelin
  0 siblings, 0 replies; 9+ messages in thread
From: Johannes Schindelin @ 2020-11-18 22:25 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Schindelin via GitGitGadget, git

Hi Junio,

On Wed, 18 Nov 2020, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>
> > The four test scripts for which I sent patch series in the past hours to
> > remove the use of the name `master` won't be touched by v3 of this here
> > patch series at all (because it won't be necessary anymore).
>
> Ah, OK.  I somehow had an impression that the big series was more or
> less done

Me, too. And if I had listened to certain people who claim that lazy
programmers are the best programmers, I would have stopped there, too.

> but rethinking the structure and ejecting these changes to tests that do
> not care what name the "init" uses by default from the series makes a
> lot of sense.

Yep.

Ciao,
Dscho

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

end of thread, other threads:[~2020-11-18 22:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 14:49 [PATCH 0/3] t2106 vs. the default branch name Johannes Schindelin via GitGitGadget
2020-11-18 14:49 ` [PATCH 1/3] t2106: adjust style to the current conventions Johannes Schindelin via GitGitGadget
2020-11-18 14:49 ` [PATCH 2/3] t2106: make test independent of the current main branch name Johannes Schindelin via GitGitGadget
2020-11-18 18:26   ` Junio C Hamano
2020-11-18 14:49 ` [PATCH 3/3] t2106: ensure that the checkout fails for the expected reason Johannes Schindelin via GitGitGadget
2020-11-18 20:46 ` [PATCH 0/3] t2106 vs. the default branch name Junio C Hamano
2020-11-18 20:56   ` Johannes Schindelin
2020-11-18 21:53     ` Junio C Hamano
2020-11-18 22:25       ` Johannes Schindelin

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).