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
Mike Hommey <mh@glandium.org>
Date
Feb 18, 2008, 19:00 UTC
Message-ID
<20080218190043.GA24240@glandium.org>
In-Reply-To
<alpine.LSU.1.00.0802181328380.30505@racer.site>
On Mon, Feb 18, 2008 at 01:29:55PM +0000, Johannes Schindelin wrote:
Show 23 quoted lines
> Hi,
> 
> sorry, I overlooked that earlier:
> 
> On Mon, 18 Feb 2008, Jay Soffian wrote:
> 
> > 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.
Or use strbufs.
Mike
Previous: Johannes Schindelin
Message 3 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.