Re: [PATCH 5/5] branch: show upstream branch when double verbose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



El 13/4/2009, a las 10:34, Jeff King escribió:

On Thu, Apr 09, 2009 at 12:15:08PM +0200, Santi Béjar wrote:

I've been thinking about this and both formats seems OK for me,
although using the +5 -6 format for just -v seems a good point.

The trivial patch for this is below:

---
diff --git a/builtin-branch.c b/builtin-branch.c
index 3275821..c056a4d 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -317,14 +317,14 @@ static void fill_tracking_info(struct strbuf *stat, const char *branch_name,

	strbuf_addch(stat, '[');
	if (show_upstream_ref)
-		strbuf_addf(stat, "%s: ",
+		strbuf_addf(stat, "%s ",
			shorten_unambiguous_ref(branch->merge[0]->dst));
	if (!ours)
-		strbuf_addf(stat, "behind %d] ", theirs);
+		strbuf_addf(stat, "-%d] ", theirs);
	else if (!theirs)
-		strbuf_addf(stat, "ahead %d] ", ours);
+		strbuf_addf(stat, "+%d] ", ours);
	else
-		strbuf_addf(stat, "ahead %d, behind %d] ", ours, theirs);
+		strbuf_addf(stat, "+%d -%d] ", ours, theirs);
}

static int matches_merge_filter(struct commit *commit)

I'm skeptical that people will know at a glance that "-" and "+" in this context map onto "behind" and "ahead". I think that trading off the clarity and obviousness of the words "behind" and "ahead" for the brevity of the symbols "-" and "+" wouldn't be a very good idea.

Cheers,
Wincent


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]