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

Re: [PATCH] git push: Interpret $GIT_DIR/branches in a Cogito compatible way

From
MKMartin Koegler <mkoegler@auto.tuwien.ac.at>
Date
Nov 11, 2008, 08:37 UTC
Message-ID
<20081111083704.GA4075@auto.tuwien.ac.at>
In-Reply-To
<7viqqv410q.fsf@gitster.siamese.dyndns.org>
On Mon, Nov 10, 2008 at 03:25:09PM -0800, Junio C Hamano wrote:
Show 19 quoted lines
> Martin Koegler <mkoegler@auto.tuwien.ac.at> writes:
> > Current git versions ignore everything after # (called <head> in the
> > following) when pushing. Older versions (before cf818348f1ab57),
> > interpret #<head> as part of the URL, which make git bail out.
> >
> > Ignoring the <head> part for push (fetch respects them) is unlogical.
> > As branches origin from Cogito, it is the best to correct this by
> > using the behaviour of cg-push:
> >
> > push HEAD to remote refs/heads/<head>
> >
> > Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
> 
> This message was addressed to me, but is it meant for inclusion?
> 
> I do not recall seeing an agreement on what the desired behaviour should
> be from (ex-)Cogito users, if this change of behaviour hurts real world
> usage of existing git users, andr if so how we ease this change in to the
> release.

Nobody else seemd to be interessted in this topic, so its difficult to start a discussion.

I would suggest to queue it in pu for some time and wait for other feedback.

> While I'd personally agree matching with whatever cg-push used to do might
> make the most sense in the end, I am not sure changing of behaviour
> abruptly like this is a good idea.

I'm open for any suggestion, how to make this change smoothly. I think, that doing such a behaviour change should be OK for 1.6.1 or 1.6.2:

Until v1.5.4 (9 month ago), git-push with # was totally broken. Daniel Barkalow fixed the fetch case in v1.5.4. As a side effect, git-push no longer fails, but ignores everything after #. So in my option, the current behaviour was created by chance.

> I am also not so sure url#branch is illogical; I'd suggest dropping that
> line from the commit log message in any case.
OK, I'll drop it in the next version.
Show 8 quoted lines
> > +git push uses:
> >  
> >  ------------
> > -	refs/heads/<head>:<repository>
> > +	HEAD:refs/heads/<head>
> >  ------------
> 
> Why isn't this "refs/heads/<head>:refs/heads/<head>", by the way?
1) It's Cogito behaviour (cg-push(2)):
|      It will push your commits on the current branch (or as specified
|      by the -r option) to the remote repository, provided that your
|      commits follow the last commit in the remote repository.
2) In my options, it's more flexible

If you want to push to <head>, you must create a local branch called <head>. If you want to fetch from the remote too, you must choose a name != <head> for the branches file, as you normaly don't want to fetch into a local branch. Pushing to <head> in multiple remote repositories is also more difficult, if they are used for diffent things, as they are based on one local branch.

=> It's a way to seperate the remote head names from the local ones.
mfg Martin Kögler
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “git push: Interpret $GIT_DIR/branches in a Cogito compatible way”
  1. git push: Interpret $GIT_DIR/branches in a Cogito compatible wayMartin Koegler, Nov 10, 2008
  2. Junio C HamanoNov 10, 2008
  3. Martin KoeglerNov 11, 2008
  4. Junio C HamanoNov 11, 2008
  5. Mike RalphsonNov 11, 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.