git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] branch: optionally setup branch.*.merge from upstream local branches

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 18, 2008, 14:05 UTC
Message-ID
<alpine.LSU.1.00.0802181403040.30505@racer.site>
In-Reply-To
<1203342817-19653-1-git-send-email-jaysoffian@gmail.com>
Hi,
On Mon, 18 Feb 2008, Jay Soffian wrote:
>  Incorporated Johannes' second round of feedback.
Not exactly.
Show 26 quoted lines
> diff --git a/branch.c b/branch.c
> index 1fc8788..64f0a4a 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -37,7 +37,7 @@ static int find_tracked_branch(struct remote *remote, void *priv)
>   * to infer the settings for branch.<new_ref>.{remote,merge} from the
>   * config.
>   */
> -static int setup_tracking(const char *new_ref, const char *orig_ref)
> +static int setup_tracking(const char *new_ref, const char *orig_ref, int always)
>  {
>  	char key[1024];
>  	struct tracking tracking;
> @@ -49,8 +49,12 @@ static int setup_tracking(const char *new_ref, const char *orig_ref)
>  	memset(&tracking, 0, sizeof(tracking));
>  	tracking.spec.dst = (char *)orig_ref;
>  	if (for_each_remote(find_tracked_branch, &tracking) ||
> -			!tracking.matches)
> -		return 1;
> +			!tracking.matches) {
> +		if (!always)
> +			return 1;
> +		tracking.matches = 1;
> +		tracking.src = xstrdup(orig_ref);
> +	}
>  

This looks completely different than what I commented on. And my comments suggested a different solution.

Unfortunately, I will not have time for the rest of the day to review that new thing (it is not at all obvious for me why this works as intended, and does not break anything else).

But you can use the time to write some tests ;-)

Ciao, Dscho

Previous: Jay SoffianNext: Jay Soffian
Message 2 of 5 in “branch: optionally setup branch.*.merge from upstream local branches”
  1. branch: optionally setup branch.*.merge from upstream local branchesJay Soffian, Feb 18, 2008
  2. Johannes SchindelinFeb 18, 2008
  3. Jay SoffianFeb 18, 2008
  4. Johannes SchindelinFeb 18, 2008
  5. Junio C HamanoFeb 18, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.