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

Re: Errors pushing tags in "next"

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 23, 2007, 09:13 UTC
Message-ID
<200703230913.12742.andyparkins@gmail.com>
In-Reply-To
<7v7it8s7c4.fsf@assigned-by-dhcp.cox.net>
On Friday 2007 March 23 08:16, Junio C Hamano wrote:
> $ git grep -e 'to the masses' -e 'Pushing v'
>
> returns absolutely empty.

As Doc Brown once said: "That's because you're not thinking four dimensionally" ;-)

 git-show v1.4.4:templates/hooks--update | grep masses
Luben: that message is being generated by the remote version of git rather 
than your local version.  It doesn't matter that /you/ don't have any hook 
scripts enabled, what matters is that the remote repository has them enabled.  
In particular the hooks/update script has been enabled.

The output you show is from the update hook from an older version of git, but the git you're running on the remote end is a newer version. The hook scripts don't get updated when you upgrade git because they're copied to the repository from the latest template when you clone or init.

Now: onto the fault; this same fault was fixed in the sample hook in revision 
a2ee81bb7594b; the problem is that the older update hook used to split the 
output of git-describe on the last dash and made the assumption that 
everything before the dash was a tag name.  git-describe gained a nice new 
feature were it would show the number of revisions since that tag as well.  
So now the output of git-describe is
  tag-N-revision

So you can see that splitting on the last dash would return "tag-N" rather than "tag". Now, when the update hook uses this "tag-N" as if it were a tag, git obviously doesn't find it, so you're fatal error is coming from running something like:

 git-rev-list v2.6.21-rc3-329..bac6eefe96204d0ad67d144f2511a6fc487aa594
becuase "v2.6.21-rc3-329" is not a tag.

The fix: My own suggestion would be to just swap the update hook on the server for the one that came with the latest version of git (although I'm completely biased :-)). Remember to do this on the remote repository, not your local one. Alternatively you could fix just that bug in the hook script you have to leave things as close as possible to what you've got now, by editing .git/hooks/update and making this change:

-  prev=$(git describe "$3^" | sed 's/-g.*//')
+  prev=$(git describe --abbrev=0 "$3^")

Alternatively; I've got a further update to the notification email script prepared that I'm finishing testing and will send today that updates to use the post-receive hook rather than the update hook and fixes a number of bugs.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
Previous: Luben TuikovNext: Luben Tuikov
Message 11 of 12 in “Errors pushing tags in "next"”
  1. Luben TuikovMar 23, 2007
  2. Junio C HamanoMar 23, 2007
  3. Luben TuikovMar 23, 2007
  4. Junio C HamanoMar 23, 2007
  5. Luben TuikovMar 23, 2007
  6. Junio C HamanoMar 23, 2007
  7. Marco RoelandMar 23, 2007
  8. Junio C HamanoMar 23, 2007
  9. Luben TuikovMar 23, 2007
  10. Luben TuikovMar 23, 2007
  11. Andy ParkinsMar 23, 2007
  12. Luben TuikovMar 23, 2007

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.