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, 13:29 UTC
Message-ID
<alpine.LSU.1.00.0802181328380.30505@racer.site>
In-Reply-To
<1203341084-18543-1-git-send-email-jaysoffian@gmail.com>
Hi,
sorry, I overlooked that earlier:
On Mon, 18 Feb 2008, Jay Soffian wrote:
Show 10 quoted lines
> diff --git a/branch.c b/branch.c
> index 1fc8788..24e98dd 100644
> --- a/branch.c
> +++ b/branch.c
> @@ -130,7 +130,15 @@ void create_branch(const char *head,
>  	   automatically merges from there.  So far, this is only done for
>  	   remotes registered via .git/config.  */
>  	if (real_ref && track)
> -		setup_tracking(name, real_ref);
> +		if (setup_tracking(name, real_ref) == 1 && track == BRANCH_TRACK_ALWAYS) {
This line is too long.
> +			char key[1024];
> +			sprintf(key, "branch.%s.remote", name);
To stay safe, you should use snprintf() and test the return value.
> +			git_config_set(key, ".");
> +			sprintf(key, "branch.%s.merge", name);
Same here.

Thanks, Dscho

Previous: Jay SoffianNext: Mike Hommey
Message 2 of 3 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. Mike HommeyFeb 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.