All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Jonathan Niedier" <jrnieder@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jiang Xin" <worldhello.net@gmail.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 1/6] Remove i18n legos in notifying new branch tracking setup
Date: Thu, 31 May 2012 20:04:37 +0700	[thread overview]
Message-ID: <1338469482-30936-2-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1338469482-30936-1-git-send-email-pclouds@gmail.com>


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 branch.c | 48 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 33 insertions(+), 15 deletions(-)

diff --git a/branch.c b/branch.c
index eccdaf9..d8facf7 100644
--- a/branch.c
+++ b/branch.c
@@ -74,25 +74,43 @@ void install_branch_config(int flag, const char *local, const char *origin, cons
 		strbuf_addf(&key, "branch.%s.rebase", local);
 		git_config_set(key.buf, "true");
 	}
+	strbuf_release(&key);
 
 	if (flag & BRANCH_CONFIG_VERBOSE) {
-		strbuf_reset(&key);
-
-		strbuf_addstr(&key, origin ? "remote" : "local");
-
-		/* Are we tracking a proper "branch"? */
-		if (remote_is_branch) {
-			strbuf_addf(&key, " branch %s", shortname);
-			if (origin)
-				strbuf_addf(&key, " from %s", origin);
+		if (rebasing) {
+			if (remote_is_branch) {
+				if (origin)
+					printf("Branch %s set up to track remote branch %s from %s by rebasing.\n",
+					       local, shortname, origin);
+				else
+					printf("Branch %s set up to track local branch %s by rebasing.\n",
+					       local, shortname);
+			} else {
+				if (origin)
+					printf("Branch %s set up to track remote ref %s by rebasing.\n",
+					       local, remote);
+				else
+					printf("Branch %s set up to track local ref %s by rebasing.\n",
+					       local, remote);
+			}
+		} else {
+			if (remote_is_branch) {
+				if (origin)
+					printf("Branch %s set up to track remote branch %s from %s.\n",
+					       local, shortname, origin);
+				else
+					printf("Branch %s set up to track local branch %s.\n",
+					       local, shortname);
+			} else {
+				if (origin)
+					printf("Branch %s set up to track remote ref %s.\n",
+					       local, remote);
+				else
+					printf("Branch %s set up to track local ref %s.\n",
+					       local, remote);
+			}
 		}
-		else
-			strbuf_addf(&key, " ref %s", remote);
-		printf("Branch %s set up to track %s%s.\n",
-		       local, key.buf,
-		       rebasing ? " by rebasing" : "");
 	}
-	strbuf_release(&key);
 }
 
 /*
-- 
1.7.10.2.549.g9354186

  reply	other threads:[~2012-05-31 13:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 11:20 [PATCH] i18n: apply: split to fix a partial i18n message Jiang Xin
2012-05-31 13:04 ` Nguyễn Thái Ngọc Duy
2012-05-31 13:04   ` Nguyễn Thái Ngọc Duy [this message]
2012-05-31 14:00     ` [PATCH 1/6] Remove i18n legos in notifying new branch tracking setup Jonathan Nieder
2012-05-31 13:04   ` [PATCH 2/6] reflog: remove i18n legos in pruning message Nguyễn Thái Ngọc Duy
2012-05-31 13:45     ` Jonathan Nieder
2012-05-31 14:00       ` Nguyen Thai Ngoc Duy
2012-05-31 14:10         ` Jonathan Nieder
2012-05-31 14:18           ` Nguyen Thai Ngoc Duy
2012-05-31 17:56       ` Junio C Hamano
2012-05-31 20:31         ` Jonathan Nieder
2012-05-31 13:04   ` [PATCH 3/6] merge-recursive: remove i18n legos in conflict messages Nguyễn Thái Ngọc Duy
2012-05-31 13:52     ` Jonathan Nieder
2012-05-31 13:56       ` Nguyen Thai Ngoc Duy
2012-05-31 13:04   ` [PATCH 4/6] notes-merge: remove i18n legos in merge result message Nguyễn Thái Ngọc Duy
2012-05-31 13:04   ` [PATCH 5/6] rerere: remove i18n legos in " Nguyễn Thái Ngọc Duy
2012-05-31 13:04   ` [PATCH 6/6] unpack-trees: remove i18n legos in unpack's porcelain error messages Nguyễn Thái Ngọc Duy
     [not found] <0001-Remove-i18n-legos-in-notifying-new-branch-tracking-s.patch>
2012-06-07 12:05 ` [PATCH 1/6] Remove i18n legos in notifying new branch tracking setup Nguyễn Thái Ngọc Duy
2012-06-07 18:44   ` Junio C Hamano

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=1338469482-30936-2-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=worldhello.net@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.