git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Ping Yin <pkufranky@gmail.com>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: [PATCH] git-submodule summary: fix that some "wc" flavors produce leading spaces
Date: Wed, 12 Mar 2008 09:30:01 +0100	[thread overview]
Message-ID: <47D79489.2070004@viscovery.net> (raw)
In-Reply-To: <1205243539-797-3-git-send-email-pkufranky@gmail.com>

From: Johannes Sixt <johannes.sixt@telecom.at>

We print the number of commits in parentheses, but without this change
we would get an oddly looking line like this:

    * sm1 4c8d358...41fbea9 (      4):

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---

	How portable is this?

	-- Hannes

 git-submodule.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index f7a6ee2..221a4c8 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -462,7 +462,7 @@ cmd_summary() {
 			GIT_DIR="$name/.git" \
 			git log --pretty=oneline --first-parent $range | wc -l
 			)
-			total_commits=" ($total_commits)"
+			total_commits=" ($(($total_commits + 0)))"
 			;;
 		esac

-- 
1.5.4.4.1329.g2c612

      parent reply	other threads:[~2008-03-12  8:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 13:52 [PATCH v5 0/5] git-submodule summary Ping Yin
2008-03-11 13:52 ` [PATCH v5 1/5] git-submodule summary: code framework Ping Yin
2008-03-11 13:52   ` [PATCH v5 2/5] git-submodule summary: show commit summary Ping Yin
2008-03-11 13:52     ` [PATCH v5 3/5] git-submodule summary: limit summary size Ping Yin
2008-03-11 13:52       ` [PATCH v5 4/5] git-submodule summary: documentation Ping Yin
2008-03-11 13:52         ` [PATCH v5 5/5] git-submodule summary: test Ping Yin
2008-03-12  2:08     ` [PATCH v5 2/5] git-submodule summary: show commit summary Ping Yin
2008-03-12  2:12       ` Junio C Hamano
2008-03-12  2:30         ` Ping Yin
2008-03-12  4:12     ` Junio C Hamano
2008-03-12  4:28       ` Ping Yin
2008-03-12  6:15         ` Junio C Hamano
2008-03-12  8:27           ` Ping Yin
2008-03-12  8:30     ` Johannes Sixt [this message]

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=47D79489.2070004@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pkufranky@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).