git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH] branch: only print upstream relationship with -v -v
Date: Wed, 17 Mar 2010 22:05:44 +0700	[thread overview]
Message-ID: <1268838344-8581-1-git-send-email-pclouds@gmail.com> (raw)

"git branch -v" is unusable for me because it's too slow. After this
patch:

pclouds@do ~/w/git $ time ./git branch -v > /dev/null
real    0m0.016s
user    0m0.011s
sys     0m0.004s

pclouds@do ~/w/git $ time ./git branch -v -v > /dev/null
real    0m8.960s
user    0m8.854s
sys     0m0.029s

This is on a repository with ~30 branches, some are hundreds of
patches behind upstream.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Maybe it's just me, with my old branches...

 Documentation/git-branch.txt |    6 +++---
 builtin/branch.c             |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index 903a690..4380846 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -101,9 +101,9 @@ OPTIONS
 
 -v::
 --verbose::
-	Show sha1 and commit subject line for each head, along with
-	relationship to upstream branch (if any). If given twice, print
-	the name of the upstream branch, as well.
+	Show sha1 and commit subject line for each head. If given twice,
+	also the relationship to upstream branch (if any). If given
+	three times, print the name of the upstream branch, as well.
 
 --abbrev=<length>::
 	Alter the sha1's minimum display length in the output listing.
diff --git a/builtin/branch.c b/builtin/branch.c
index 6cf7e72..eb407f0 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -439,8 +439,8 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
 			sub = subject.buf;
 		}
 
-		if (item->kind == REF_LOCAL_BRANCH)
-			fill_tracking_info(&stat, item->name, verbose > 1);
+		if (item->kind == REF_LOCAL_BRANCH && verbose > 1)
+			fill_tracking_info(&stat, item->name, verbose > 2);
 
 		strbuf_addf(&out, " %s %s%s",
 			find_unique_abbrev(item->commit->object.sha1, abbrev),
-- 
1.7.0.1.390.g67bca

             reply	other threads:[~2010-03-17 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 15:05 Nguyễn Thái Ngọc Duy [this message]
2010-03-17 16:21 ` [PATCH] branch: only print upstream relationship with -v -v Michael J Gruber
2010-03-17 16:53 ` Junio C Hamano
2010-03-18  0:06   ` Nguyen Thai Ngoc Duy

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=1268838344-8581-1-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /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).