Re: [PATCH] branch: fix funny-sounding error message

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

 



Alex Henrie <alexhenrie24@xxxxxxxxx> writes:

> Signed-off-by: Alex Henrie <alexhenrie24@xxxxxxxxx>
> ---
>  builtin/branch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/branch.c b/builtin/branch.c
> index 1d15037..c0b4bae 100644
> --- a/builtin/branch.c
> +++ b/builtin/branch.c
> @@ -972,7 +972,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
>  
>  		if (!branch) {
>  			if (!argc || !strcmp(argv[0], "HEAD"))
> -				die(_("could not set upstream of HEAD to %s when "
> +				die(_("could not set upstream of HEAD to %s because "
>  				      "it does not point to any branch."),
>  				    new_upstream);
>  			die(_("no such branch '%s'"), argv[0]);

Thanks.

To me neither sounds so funny, but both sound somewhat awkward,
primarily because it is unclear in the first reading what "it" in
"it does not point at any branch" refers to.

Perhaps if you explain in the log message to illustrate why you
found it funny (and the update text is not), it might help, e.g.

    "git branch", ran with <this and that options>, when the current
    branch is <in what state>, dies with

    	fatal: could not set upstream of HEAD to frotz when it does not
    	point to any branch.

    which is funny <because of such and such reasons>.  Saying "because"
    makes it <better beause of such and such reasons>.

I suspect that this message is about a nonsense attempt to set an
upstream for a detached HEAD perhaps?  Then

    fatal: cannot set upstream for a detached HEAD

may be shorter and more directly points at the root cause of the
error?
--
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]