git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Rubén Justo" <rjusto@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] branch: description for non-existent branch errors
Date: Tue, 27 Sep 2022 15:24:41 -0700	[thread overview]
Message-ID: <xmqqedvw1mmu.fsf@gitster.g> (raw)
In-Reply-To: <26a5cbe2-d821-e7f6-e56f-4ad90ef2cf2d@gmail.com> ("Rubén Justo"'s message of "Tue, 27 Sep 2022 01:35:13 +0200")

Rubén Justo <rjusto@gmail.com> writes:

> I pointed out in the first mail of this thread, there is already a patch in
> 'seen' that touches builtin/branch.c [1].  I would like to keep the patches
> separated, but I don't know how to proceed: make the change from 'seen', keep
> it from 'master'... Maybe you can give me some guidance in this.

I do not see much problem in keeping them separated.  My trial merge
of the result of applying this patch on top of 'master', with the
other topic that has the "branch description for nth prior checkout"
patch does show a minor textual conflict, but the resolution does
not look too bad.

Check near the topic branch of 'seen' after I push out today's
integration result in a few hours and see if they look reasonable.

Thanks.


diff --cc builtin/branch.c
index 5ca35064f3,13d1f028da..2b3884ce61
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@@ -810,19 -807,18 +814,18 @@@ int cmd_branch(int argc, const char **a
  
  		strbuf_addf(&branch_ref, "refs/heads/%s", branch_name);
  		if (!ref_exists(branch_ref.buf)) {
- 			strbuf_release(&branch_ref);
- 
 -			if (!argc)
 +			if (!argc || !strcmp(head, branch_name))
- 				return error(_("No commit on branch '%s' yet."),
+ 				ret = error(_("No commit on branch '%s' yet."),
  					     branch_name);
  			else
- 				return error(_("No branch named '%s'."),
+ 				ret = error(_("No branch named '%s'."),
  					     branch_name);
- 		}
- 		strbuf_release(&branch_ref);
+ 		} else
+ 			ret = edit_branch_description(branch_name);
  
- 		if (edit_branch_description(branch_name))
- 			return 1;
+ 		strbuf_release(&branch_ref);
+ 		strbuf_release(&buf);
+ 		return -ret;
  	} else if (copy) {
  		if (!argc)
  			die(_("branch name required"));

  reply	other threads:[~2022-09-27 22:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 22:37 [PATCH] branch: description for non-existent branch errors Rubén Justo
2022-09-24 22:52 ` Rubén Justo
2022-09-26 18:12   ` Junio C Hamano
2022-09-26 23:35     ` Rubén Justo
2022-09-27 22:24       ` Junio C Hamano [this message]
2022-09-28 17:41         ` Junio C Hamano
2022-09-28 17:50         ` Junio C Hamano
2022-09-28 23:59           ` Rubén Justo
2022-09-29  1:56             ` Junio C Hamano
2022-09-30 22:47 ` [PATCH v2] " Rubén Justo
2022-10-01 12:43   ` Bagas Sanjaya
2022-10-02 21:28     ` Rubén Justo
2022-10-08  0:39   ` [PATCH v3] " Rubén Justo
2022-10-08  3:27     ` Eric Sunshine
2022-10-08  8:54       ` Rubén Justo
2022-10-09  5:05         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqedvw1mmu.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rjusto@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.
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).