* [PATCH] branch: change the error messages to be more meaningful
@ 2017-07-25 14:39 Kaartic Sivaraam
2017-07-25 18:28 ` Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-25 14:39 UTC (permalink / raw)
To: git
The error messages shown when the branch command is misused
by supplying it wrong number of parameters wasn't meaningful
as it used the the phrase, "too many branches" which is not
meaningful in the following case,
$ git branch
foo
* master
$ git branch -m foo foo test
fatal: too many branches for a rename operation
It's not meaningful as the implementation assumed all parameters
to be branch names. It's not always the case as exemplified above.
Change the messages to be more general thus making no asssumptions
about the "parameters".
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
builtin/branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index a3bd2262b3367..59fedf085d3db 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many parameters for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many parameters to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many parameters to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
--
https://github.com/git/git/pull/387
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] branch: change the error messages to be more meaningful
2017-07-25 14:39 [PATCH] branch: change the error messages to be more meaningful Kaartic Sivaraam
@ 2017-07-25 18:28 ` Kaartic Sivaraam
2017-07-25 18:31 ` Kaartic Sivaraam
2017-07-30 11:59 ` Kaartic Sivaraam
0 siblings, 2 replies; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-25 18:28 UTC (permalink / raw)
To: git
The error messages shown when the branch command is misused
by supplying it wrong number of parameters wasn't meaningful.
That's because it used the the phrase "too many branches"
assuming all parameters to be "valid" branch names. It's not
always the case as exemplified below,
$ git branch
foo
* master
$ git branch -m foo foo old
fatal: too many branches for a rename operation
Change the messages to be more general thus making no assumptions
about the "parameters".
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
builtin/branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index a3bd2262b3367..59fedf085d3db 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many parameters for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many parameters to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many parameters to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
--
https://github.com/git/git/pull/389
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH] branch: change the error messages to be more meaningful
2017-07-25 18:28 ` Kaartic Sivaraam
@ 2017-07-25 18:31 ` Kaartic Sivaraam
2017-07-30 11:59 ` Kaartic Sivaraam
1 sibling, 0 replies; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-25 18:31 UTC (permalink / raw)
To: git
The second patch differs from the first one only in the commit message.
--
Kaartic
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] branch: change the error messages to be more meaningful
2017-07-25 18:28 ` Kaartic Sivaraam
2017-07-25 18:31 ` Kaartic Sivaraam
@ 2017-07-30 11:59 ` Kaartic Sivaraam
2017-08-21 13:36 ` [PATCH v2] " Kaartic Sivaraam
1 sibling, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-30 11:59 UTC (permalink / raw)
To: gitster; +Cc: git
The error messages shown when the branch command is misused
by supplying it wrong number of parameters wasn't meaningful.
That's because it used the the phrase "too many branches"
assuming all parameters to be "valid" branch names. It's not
always the case as exemplified below,
$ git branch
foo
* master
$ git branch -m foo foo old
fatal: too many branches for a rename operation
Change the messages to be more general thus making no assumptions
about the "parameters".
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
Sending this patch to the correct thread. I apologise if this
seems reduntant. I'm having hard time keeping up with the patch-flow
without 'send-email'!
builtin/branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index a3bd2262b..59fedf085 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many parameters for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many parameters to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many parameters to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
--
2.14.0.rc1.434.g6eded367a
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2] branch: change the error messages to be more meaningful
2017-07-30 11:59 ` Kaartic Sivaraam
@ 2017-08-21 13:36 ` Kaartic Sivaraam
2017-10-02 17:19 ` Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-08-21 13:36 UTC (permalink / raw)
To: gitster; +Cc: git
The error messages shown when the branch command is misused
by supplying it wrong number of parameters wasn't meaningful.
That's because it used the the phrase "too many branches"
assuming all parameters to be "valid" branch names. It's not
always the case as exemplified below,
$ git branch
foo
* master
$ git branch -m foo foo old
fatal: too many branches for a rename operation
Change the messages to be more general thus making no assumptions
about the "parameters".
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
Changes in v2:
- changed the wordings of the error message
builtin/branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index a3bd2262b..62981d358 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many arguments for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many arguments to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many arguments to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
--
2.14.0.rc1.434.g6eded367a
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-08-21 13:36 ` [PATCH v2] " Kaartic Sivaraam
@ 2017-10-02 17:19 ` Kaartic Sivaraam
2017-10-03 0:21 ` Junio C Hamano
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-10-02 17:19 UTC (permalink / raw)
To: gitster; +Cc: git
On Mon, 2017-08-21 at 19:06 +0530, Kaartic Sivaraam wrote:
> The error messages shown when the branch command is misused
> by supplying it wrong number of parameters wasn't meaningful.
> That's because it used the the phrase "too many branches"
> assuming all parameters to be "valid" branch names. It's not
> always the case as exemplified below,
>
> $ git branch
> foo
> * master
>
> $ git branch -m foo foo old
> fatal: too many branches for a rename operation
>
> Change the messages to be more general thus making no assumptions
> about the "parameters".
>
> Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
> ---
> Changes in v2:
>
> - changed the wordings of the error message
>
> builtin/branch.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index a3bd2262b..62981d358 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
> else if (argc == 2)
> rename_branch(argv[0], argv[1], rename > 1);
> else
> - die(_("too many branches for a rename operation"));
> + die(_("too many arguments for a rename operation"));
> } else if (new_upstream) {
> struct branch *branch = branch_get(argv[0]);
>
> if (argc > 1)
> - die(_("too many branches to set new upstream"));
> + die(_("too many arguments to set new upstream"));
>
> if (!branch) {
> if (!argc || !strcmp(argv[0], "HEAD"))
> @@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
> struct strbuf buf = STRBUF_INIT;
>
> if (argc > 1)
> - die(_("too many branches to unset upstream"));
> + die(_("too many arguments to unset upstream"));
>
> if (!branch) {
> if (!argc || !strcmp(argv[0], "HEAD"))
I was recently searching to find the patches have gone missing in to
the void for no obvious reason and found this. Should I consider this
to be "Dropped" in terms of the "What's cooking" emails? or has this
just not received the required attention?
---
Kaartic
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-02 17:19 ` Kaartic Sivaraam
@ 2017-10-03 0:21 ` Junio C Hamano
2017-10-03 19:14 ` Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2017-10-03 0:21 UTC (permalink / raw)
To: Kaartic Sivaraam; +Cc: git
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> I was recently searching to find the patches have gone missing in to
> the void for no obvious reason and found this. Should I consider this
> to be "Dropped" in terms of the "What's cooking" emails? or has this
> just not received the required attention?
I do not even recall what the patches did and if I thought what they
wanted to do made sense, so I wouldn't be surprised if I did not
pick them up, after seeing nobody's commenting on it.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-03 0:21 ` Junio C Hamano
@ 2017-10-03 19:14 ` Kaartic Sivaraam
2017-10-04 4:11 ` Junio C Hamano
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-10-03 19:14 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Tue, 2017-10-03 at 09:21 +0900, Junio C Hamano wrote:
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
>
> I do not even recall what the patches did and if I thought what they
> wanted to do made sense,
I thought you did or may be I misinterpreted the following statement,
On Thursday 17 August 2017 12:58 AM, Junio C Hamano wrote:
> I do not find the s/branch/parameter/ too bad (although I would have
> said "arguments" instead).
>
I interpreted the "not .. too bad" as a "it makes little sense". So,
pinged the thread.
---
Kaartic
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-03 19:14 ` Kaartic Sivaraam
@ 2017-10-04 4:11 ` Junio C Hamano
2017-10-04 12:46 ` Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2017-10-04 4:11 UTC (permalink / raw)
To: Kaartic Sivaraam; +Cc: git
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> I interpreted the "not .. too bad" as a "it makes little sense". So,
> pinged the thread.
Thanks. I think what the patch does (sort of) makes sense.
It is a bit dissapointing that we do not need to touch tests, as it
indicates that the logic to diagnose extra arguments as an error has
no coverage.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-04 4:11 ` Junio C Hamano
@ 2017-10-04 12:46 ` Kaartic Sivaraam
2017-10-05 1:13 ` Junio C Hamano
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-10-04 12:46 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Wed, 2017-10-04 at 13:11 +0900, Junio C Hamano wrote:
>
> It is a bit dissapointing that we do not need to touch tests, as it
> indicates that the logic to diagnose extra arguments as an error has
> no coverage.
Even if there were tests I don't think they would have needed any
updation as most of the tests (at least those that I came across) that
check for failure seem not to be checking for what error message gets
printed. They seem to test only if the command fails (using
test_must_fail in most cases, I guess).
Moreover, as a consequence of my assumption that the tests don't check
for the error messages themselves; I haven't even thought of checking
whether the tests or the travis-ci build succeeded as a consequence of
my patches that touch "only" the error messages!
---
Kaartic
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-04 12:46 ` Kaartic Sivaraam
@ 2017-10-05 1:13 ` Junio C Hamano
2017-10-05 12:13 ` Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2017-10-05 1:13 UTC (permalink / raw)
To: Kaartic Sivaraam; +Cc: git
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
> Moreover, as a consequence of my assumption that the tests don't check
> for the error messages themselves; I haven't even thought of checking
> whether the tests or the travis-ci build succeeded as a consequence of
> my patches that touch "only" the error messages!
That's a bad thing, right?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] branch: change the error messages to be more meaningful
2017-10-05 1:13 ` Junio C Hamano
@ 2017-10-05 12:13 ` Kaartic Sivaraam
0 siblings, 0 replies; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-10-05 12:13 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Thu, 2017-10-05 at 10:13 +0900, Junio C Hamano wrote:
> Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> writes:
>
> > Moreover, as a consequence of my assumption that the tests don't check
> > for the error messages themselves; I haven't even thought of checking
> > whether the tests or the travis-ci build succeeded as a consequence of
> > my patches that touch "only" the error messages!
>
> That's a bad thing, right?
Might be, but my assumption seems to held at least until now for the
two or three patches that I have sent that touch "only" the error
messages (I haven't received emails from anyone shouting at me that the
build fails as a consequence of one such patches).
The build status for this patch can be found at [1]. Supporting my
assumption, it passed too.
That said, you don't have to worry a lot about this. I'll come over my
laziness and check if the travis-ci build passes for such patches in
the future :-)
[1]: https://travis-ci.org/sivaraam/git/builds/276222235
---
Kaartic
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] remote: split and simplify messages
@ 2017-07-26 13:18 Kaartic Sivaraam
2017-07-30 11:13 ` [PATCH] branch: change the error messages to be more meaningful Kaartic Sivaraam
0 siblings, 1 reply; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-26 13:18 UTC (permalink / raw)
To: git
Splitting a single sentence across multiple lines could
degrade readability. Further, long messages are likely
to be ignored by users.
Split the sentences and simplify it to improve their readability.
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
remote.c | 18 ++++-----
t/t2020-checkout-detach.sh | 3 +-
t/t7508-status.sh | 96 +++++++++++++++++++++++-----------------------
3 files changed, 58 insertions(+), 59 deletions(-)
diff --git a/remote.c b/remote.c
index 60d004392109f..e4e241d5e20f4 100644
--- a/remote.c
+++ b/remote.c
@@ -2093,10 +2093,10 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
_(" (use \"git push\" to publish your local commits)\n"));
} else if (!ours) {
strbuf_addf(sb,
- Q_("Your branch is behind '%s' by %d commit, "
- "and can be fast-forwarded.\n",
- "Your branch is behind '%s' by %d commits, "
- "and can be fast-forwarded.\n",
+ Q_("Your branch is behind '%s' by %d commit.\n"
+ "It can be fast-forwarded.\n",
+ "Your branch is behind '%s' by %d commits.\n"
+ "It can be fast-forwarded.\n",
theirs),
base, theirs);
if (advice_status_hints)
@@ -2104,12 +2104,10 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
_(" (use \"git pull\" to update your local branch)\n"));
} else {
strbuf_addf(sb,
- Q_("Your branch and '%s' have diverged,\n"
- "and have %d and %d different commit each, "
- "respectively.\n",
- "Your branch and '%s' have diverged,\n"
- "and have %d and %d different commits each, "
- "respectively.\n",
+ Q_("Your branch and '%s' have diverged.\n"
+ "They have %d and %d different commit, respectively.\n",
+ "Your branch and '%s' have diverged.\n"
+ "They have %d and %d different commits, respectively.\n",
ours + theirs),
base, ours, theirs);
if (advice_status_hints)
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh
index fbb4ee9bb42db..4e1c74c878560 100755
--- a/t/t2020-checkout-detach.sh
+++ b/t/t2020-checkout-detach.sh
@@ -150,7 +150,8 @@ test_expect_success 'checkout does not warn leaving reachable commit' '
'
cat >expect <<'EOF'
-Your branch is behind 'master' by 1 commit, and can be fast-forwarded.
+Your branch is behind 'master' by 1 commit.
+It can be fast-forwarded.
(use "git pull" to update your local branch)
EOF
test_expect_success 'tracking count is accurate after orphan check' '
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 43d19a9b22920..fd7f27ee01ab0 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -88,8 +88,8 @@ EOF
test_expect_success 'status --column' '
cat >expect <<\EOF &&
# On branch master
-# Your branch and '\''upstream'\'' have diverged,
-# and have 1 and 2 different commits each, respectively.
+# Your branch and '\''upstream'\'' have diverged.
+# They have 1 and 2 different commits, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
@@ -122,8 +122,8 @@ test_expect_success 'status --column status.displayCommentPrefix=false' '
cat >expect <<\EOF
# On branch master
-# Your branch and 'upstream' have diverged,
-# and have 1 and 2 different commits each, respectively.
+# Your branch and 'upstream' have diverged.
+# They have 1 and 2 different commits, respectively.
# (use "git pull" to merge the remote branch into yours)
#
# Changes to be committed:
@@ -199,8 +199,8 @@ test_expect_success 'commit ignores status.displayCommentPrefix=false in COMMIT_
cat >expect <<\EOF
On branch master
-Your branch and 'upstream' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and 'upstream' have diverged.
+They have 1 and 2 different commits, respectively.
Changes to be committed:
new file: dir2/added
@@ -272,8 +272,8 @@ test_expect_success 'status with gitignore' '
cat >expect <<\EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -341,8 +341,8 @@ test_expect_success 'status with gitignore (nothing untracked)' '
cat >expect <<\EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -414,8 +414,8 @@ test_expect_success 'setup dir3' '
test_expect_success 'status -uno' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -444,8 +444,8 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
test_expect_success 'status -uno (advice.statusHints false)' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
Changes to be committed:
new file: dir2/added
@@ -478,8 +478,8 @@ test_expect_success 'status -s (status.showUntrackedFiles no)' '
test_expect_success 'status -unormal' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -536,8 +536,8 @@ test_expect_success 'status -s (status.showUntrackedFiles normal)' '
test_expect_success 'status -uall' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -599,8 +599,8 @@ test_expect_success 'status -s (status.showUntrackedFiles all)' '
test_expect_success 'status with relative paths' '
cat >expect <<\EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -670,8 +670,8 @@ test_expect_success 'setup unique colors' '
test_expect_success 'status with color.ui' '
cat >expect <<\EOF &&
On branch <GREEN>master<RESET>
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -796,8 +796,8 @@ test_expect_success 'status --porcelain respects -b' '
test_expect_success 'status without relative paths' '
cat >expect <<\EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -846,8 +846,8 @@ test_expect_success 'status -s without relative paths' '
test_expect_success 'dry-run of partial commit excluding new file in index' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -890,8 +890,8 @@ test_expect_success 'setup status submodule summary' '
test_expect_success 'status submodule summary is disabled by default' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -950,8 +950,8 @@ head=$(cd sm && git rev-parse --short=7 --verify HEAD)
test_expect_success 'status submodule summary' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 1 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 1 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1012,8 +1012,8 @@ test_expect_success 'status -s submodule summary' '
test_expect_success 'status submodule summary (clean submodule): commit' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
@@ -1062,8 +1062,8 @@ test_expect_success 'status -z implies porcelain' '
test_expect_success 'commit --dry-run submodule summary (--amend)' '
cat >expect <<EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1119,8 +1119,8 @@ touch .gitmodules
test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
cat > expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1231,8 +1231,8 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with modifie
test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
cat > expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1291,8 +1291,8 @@ head2=$(cd sm && git commit -q -m "2nd commit" foo && git rev-parse --short=7 --
test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
cat > expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1375,8 +1375,8 @@ test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary
cat > expect << EOF
; On branch master
-; Your branch and 'upstream' have diverged,
-; and have 2 and 2 different commits each, respectively.
+; Your branch and 'upstream' have diverged.
+; They have 2 and 2 different commits, respectively.
; (use "git pull" to merge the remote branch into yours)
;
; Changes to be committed:
@@ -1426,8 +1426,8 @@ test_expect_success "status (core.commentchar with two chars with submodule summ
test_expect_success "--ignore-submodules=all suppresses submodule summary" '
cat > expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
@@ -1454,8 +1454,8 @@ EOF
test_expect_success '.gitmodules ignore=all suppresses unstaged submodule summary' '
cat > expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
@@ -1577,8 +1577,8 @@ test_expect_success 'git commit --dry-run will show a staged but ignored submodu
git add sm &&
cat >expect << EOF &&
On branch master
-Your branch and '\''upstream'\'' have diverged,
-and have 2 and 2 different commits each, respectively.
+Your branch and '\''upstream'\'' have diverged.
+They have 2 and 2 different commits, respectively.
(use "git pull" to merge the remote branch into yours)
Changes to be committed:
--
https://github.com/git/git/pull/391
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH] branch: change the error messages to be more meaningful
2017-07-26 13:18 [PATCH] remote: split and simplify messages Kaartic Sivaraam
@ 2017-07-30 11:13 ` Kaartic Sivaraam
0 siblings, 0 replies; 13+ messages in thread
From: Kaartic Sivaraam @ 2017-07-30 11:13 UTC (permalink / raw)
To: gitster; +Cc: git
The error messages shown when the branch command is misused
by supplying it wrong number of parameters wasn't meaningful.
That's because it used the the phrase "too many branches"
assuming all parameters to be "valid" branch names. It's not
always the case as exemplified below,
$ git branch
foo
* master
$ git branch -m foo foo old
fatal: too many branches for a rename operation
Change the messages to be more general thus making no assumptions
about the "parameters".
Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
---
builtin/branch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index a3bd2262b..59fedf085 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -707,12 +707,12 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
else if (argc == 2)
rename_branch(argv[0], argv[1], rename > 1);
else
- die(_("too many branches for a rename operation"));
+ die(_("too many parameters for a rename operation"));
} else if (new_upstream) {
struct branch *branch = branch_get(argv[0]);
if (argc > 1)
- die(_("too many branches to set new upstream"));
+ die(_("too many parameters to set new upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
@@ -735,7 +735,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
if (argc > 1)
- die(_("too many branches to unset upstream"));
+ die(_("too many parameters to unset upstream"));
if (!branch) {
if (!argc || !strcmp(argv[0], "HEAD"))
--
2.14.0.rc1.434.g6eded367a
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-10-05 12:14 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-25 14:39 [PATCH] branch: change the error messages to be more meaningful Kaartic Sivaraam
2017-07-25 18:28 ` Kaartic Sivaraam
2017-07-25 18:31 ` Kaartic Sivaraam
2017-07-30 11:59 ` Kaartic Sivaraam
2017-08-21 13:36 ` [PATCH v2] " Kaartic Sivaraam
2017-10-02 17:19 ` Kaartic Sivaraam
2017-10-03 0:21 ` Junio C Hamano
2017-10-03 19:14 ` Kaartic Sivaraam
2017-10-04 4:11 ` Junio C Hamano
2017-10-04 12:46 ` Kaartic Sivaraam
2017-10-05 1:13 ` Junio C Hamano
2017-10-05 12:13 ` Kaartic Sivaraam
-- strict thread matches above, loose matches on Subject: below --
2017-07-26 13:18 [PATCH] remote: split and simplify messages Kaartic Sivaraam
2017-07-30 11:13 ` [PATCH] branch: change the error messages to be more meaningful Kaartic Sivaraam
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).