mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Shourya Shukla <>
	Shourya Shukla <>,
	Christian Couder <>
Subject: [PATCH v3 2/5] t7401: use 'short' instead of 'verify' and cut in rev-parse calls
Date: Fri, 21 Aug 2020 22:29:49 +0530	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

'git rev-parse' can limit the number of characters in the hash it
outputs using the '--short' option, thereby, making the 'cut' invocation
redundant. Since using '--short' implies '--verify' as well, we can
safely replace the latter with the former. This change results in the
helper functions getting the hash in the same way 'summary' gets the
hash internally.

So, avoid the unnecessary invocation to 'cut' in the helper

Mentored-by: Christian Couder <>
Mentored-by: Kaartic Sivaraam <>
Signed-off-by: Shourya Shukla <>
 t/ | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/ b/t/
index 07d4ba0b26..ccbac875fe 100755
--- a/t/
+++ b/t/
@@ -21,7 +21,7 @@ add_file () {
 		test_tick &&
 		git commit -m "Add $name"
 	done >/dev/null
-	git rev-parse --verify HEAD | cut -c1-7
+	git rev-parse --short HEAD
 	cd "$owd"
 commit_file () {
@@ -125,7 +125,7 @@ commit_file sm1 &&
 	cd sm1 &&
 	git reset --hard HEAD~2 >/dev/null &&
-	git rev-parse --verify HEAD | cut -c1-7
+	git rev-parse --short HEAD
 test_expect_success 'modified submodule(backward)' "

  parent reply	other threads:[~2020-08-21 17:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 16:59 [GSoC][PATCH v3 0/5] t7401: modernize, cleanup and more Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 1/5] t7401: modernize style Shourya Shukla
2020-08-21 16:59 ` Shourya Shukla [this message]
2020-08-21 16:59 ` [PATCH v3 3/5] t7401: change syntax of test_i18ncmp calls for clarity Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 4/5] t7401: change indentation for enhanced readability Shourya Shukla
2020-08-21 16:59 ` [PATCH v3 5/5] t7401: add a NEEDSWORK Shourya Shukla

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:

  List information:

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

  git send-email \ \ \ \ \ \ \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 read-only IMAP folder(s) and NNTP newsgroup(s).