git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] t9363: Cleanup old version of code
@ 2020-10-31 15:14 izabela.bakollari
  2020-10-31 16:56 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: izabela.bakollari @ 2020-10-31 15:14 UTC (permalink / raw)
  To: git; +Cc: Izabela Bakollari

From: Izabela Bakollari <izabela.bakollari@gmail.com>

Change style for `cd` in subshell.

Signed-off-by: Izabela Bakollari <izabela.bakollari@gmail.com>
---
 contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
index 6187ec67fa..f09a7ed034 100755
--- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
+++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
@@ -53,8 +53,12 @@ test_expect_failure 'git clone works on previously created wiki with media files
 	git clone -c remote.origin.mediaimport=true \
 		mediawiki::'"$WIKI_URL"' mw_dir_clone &&
 	test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt &&
-	(cd mw_dir_clone && git checkout HEAD^) &&
-	(cd mw_dir && git checkout HEAD^) &&
+	(
+		cd mw_dir_clone && git checkout HEAD^
+	) &&
+	(
+		cd mw_dir && git checkout HEAD^
+	) &&
 	test_path_is_file mw_dir_clone/Foo.txt &&
 	test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt
 '
-- 
2.18.4


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

* Re: [PATCH] t9363: Cleanup old version of code
  2020-10-31 15:14 [PATCH] t9363: Cleanup old version of code izabela.bakollari
@ 2020-10-31 16:56 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2020-10-31 16:56 UTC (permalink / raw)
  To: izabela.bakollari; +Cc: git

izabela.bakollari@gmail.com writes:

> From: Izabela Bakollari <izabela.bakollari@gmail.com>

> Subject: [PATCH] t9363: Cleanup old version of code

Micronit.  As you can see from "git shortlog --no-merges --since=9.weeks",
the convention here is not capitalize the word after "<area>:", i.e.

    Subject: [PATCH] t9363: clean up old version of code

> Change style for `cd` in subshell.
>
> Signed-off-by: Izabela Bakollari <izabela.bakollari@gmail.com>
> ---
>  contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
> index 6187ec67fa..f09a7ed034 100755
> --- a/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
> +++ b/contrib/mw-to-git/t/t9363-mw-to-git-export-import.sh
> @@ -53,8 +53,12 @@ test_expect_failure 'git clone works on previously created wiki with media files
>  	git clone -c remote.origin.mediaimport=true \
>  		mediawiki::'"$WIKI_URL"' mw_dir_clone &&
>  	test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt &&
> -	(cd mw_dir_clone && git checkout HEAD^) &&
> -	(cd mw_dir && git checkout HEAD^) &&
> +	(
> +		cd mw_dir_clone && git checkout HEAD^
> +	) &&
> +	(
> +		cd mw_dir && git checkout HEAD^
> +	) &&

This is not wrong per-se, but I do not think it is too ambitious a
clean-up to declare

	(cd there && git any-single-git-command-with-args)

is an obsolete style and recommend it to be rewritten to

	git -C there any-single-git-command-with-args

In other words, I think

>  	test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt &&
> -	(cd mw_dir_clone && git checkout HEAD^) &&
> -	(cd mw_dir && git checkout HEAD^) &&
> +	git -C mw_dir_clone checkout HEAD^ &&
> +	git -C mw_dir checkout HEAD^ &&

would be more preferrable.

>  	test_path_is_file mw_dir_clone/Foo.txt &&
>  	test_cmp mw_dir_clone/Foo.txt mw_dir/Foo.txt
>  '

Thanks.

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

end of thread, other threads:[~2020-10-31 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-31 15:14 [PATCH] t9363: Cleanup old version of code izabela.bakollari
2020-10-31 16:56 ` Junio C Hamano

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git