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

Re: [PATCH] Fix contrib/hooks/post-receive-email for new branch with no new commits

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 10, 2009, 15:59 UTC
Message-ID
<alpine.DEB.1.00.0902101655500.10279@pacific.mpi-cbg.de>
In-Reply-To
<m3ab8uuwfg.fsf@localhost.localdomain>
Hi,
On Tue, 10 Feb 2009, Jakub Narebski wrote:
Show 14 quoted lines
> "Pat Notz" <pknotz@sandia.gov> writes:
> 
> > In the show_new_revisions function, the original code:
> > 
> >    git rev-parse --not --branches | grep -v $(git rev-parse $refname) |
> > 
> > isn't quite right since one can create a new branch and push it without
> > any new commits.  In that case, two refs will have the same sha1 but
> > both would get filtered by the 'grep'.  In the end, we'll show ALL the
> > history which is not what we want.  Instead, we should list the branches
> > by name and remove the branch being updated and THEN pass that list
> > through rev-parse.
> 
> Good idea, bad execution.
And I thought that I hold the patent for grumpy comments on this list :-)

As for your suggestions, I think they are valid. We try to keep the interface of certain commands (so called "plumbing") stable, for script consumption. "git for-each-ref" is such a command.

However, "git branch" is meant for human consumption, and a pretty recent patch wants to change the interface to make it even friendlier -- but breaking scripts' assumption in the process, should they use "git branch".

Ciao, Dscho

Previous: Jakub NarebskiNext: Junio C Hamano
Message 3 of 5 in “Fix contrib/hooks/post-receive-email for new branch with no new commits”
  1. Fix contrib/hooks/post-receive-email for new branch with no new commitsPat Notz, Feb 10, 2009
  2. Jakub NarebskiFeb 10, 2009
  3. Johannes SchindelinFeb 10, 2009
  4. Junio C HamanoFeb 10, 2009
  5. Fix contrib/hooks/post-receive-email for new duplicate branchPat Notz, Feb 10, 2009

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.