git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ping Yin" <pkufranky@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: "Johannes Sixt" <j.sixt@viscovery.net>, git@vger.kernel.org
Subject: Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary
Date: Fri, 14 Mar 2008 02:14:44 +0800	[thread overview]
Message-ID: <46dff0320803131114v3218cc5etdd729b53d3a0d44d@mail.gmail.com> (raw)
In-Reply-To: <7vprtyxzzd.fsf@gitster.siamese.dyndns.org>

On Fri, Mar 14, 2008 at 2:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Johannes Sixt <j.sixt@viscovery.net> writes:
>
>  > Ping Yin schrieb:
>  >> +cd sm &&
>  >> +head=$(git rev-parse --verify HEAD | cut -c1-7) &&
>  >> +cd ..
>  >
>  > I think you can make these three lines into:
>  >
>  > test_expect_success 'get short SHA1 of submodule HEAD' '
>  >
>  >       head=$(cd sm && git rev-parse --verify HEAD | cut -c1-7)
>  > '
>
>  "git rev-parse --short=12 --verify HEAD" or whatever minimum length you
>  would want would free you from an ugly "pipe to cut".
>
Thanks.

diff --git a/t/t7502-status.sh b/t/t7502-status.sh
index 7a9a08f..80e2a7b 100755
--- a/t/t7502-status.sh
+++ b/t/t7502-status.sh
@@ -187,9 +187,7 @@ test_expect_success
        git diff expect output
 '

-cd sm &&
-head=$(git rev-parse --verify HEAD | cut -c1-7) &&
-cd ..
+head=$(cd sm && git rev-parse --short=7 --verify HEAD)

 cat > expect <<EOF
 # On branch master



-- 
Ping Yin

  reply	other threads:[~2008-03-13 18:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 13:48 builtin-status " Ping Yin
2008-03-13 13:48 ` [PATCH v2 1/4] git-submodule summary: --for-status option Ping Yin
2008-03-13 13:48   ` [PATCH v2 2/4] builtin-status: submodule summary support Ping Yin
2008-03-13 13:48     ` [PATCH v2 3/4] builtin-status: configurable submodule summary size Ping Yin
2008-03-13 13:48       ` [PATCH v2 4/4] buitin-status: Add tests for submodule summary Ping Yin
2008-03-13 14:21         ` Johannes Sixt
2008-03-13 18:04           ` Junio C Hamano
2008-03-13 18:14             ` Ping Yin [this message]
2008-03-13 18:09           ` Ping Yin
2008-03-13 14:15       ` [PATCH v2 3/4] builtin-status: configurable submodule summary size Johannes Sixt
2008-03-13 14:11     ` [PATCH v2 2/4] builtin-status: submodule summary support Johannes Sixt
2008-03-13 18:01       ` Ping Yin
2008-03-14 14:30 ` builtin-status submodule summary Ping Yin
2008-03-14 16:39   ` Junio C Hamano
2008-03-14 17:45     ` Ping Yin

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=46dff0320803131114v3218cc5etdd729b53d3a0d44d@mail.gmail.com \
    --to=pkufranky@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j.sixt@viscovery.net \
    --subject='Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary' \
    /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

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