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

Re: [PATCH] Use git-update-ref to update a ref during commit in git-cvsserver

From
MLMartin Langhoff <martin@catalyst.net.nz>
Date
Feb 27, 2007, 23:37 UTC
Message-ID
<45E4C0BC.5090506@catalyst.net.nz>
In-Reply-To
<7vmz38t5r4.fsf@assigned-by-dhcp.cox.net>
Hi Junio, Andy,

sorry for the long delay, I'm catching up with a sizable backlog at work and in my foss projects.

I like Junio's patch -- it fixes cvsserver to work with packed refs (which needed to be done!) and does things lockless, which is a great bonus.

The meat of the matter is
Junio C Hamano wrote:
Show 9 quoted lines
> -    print LOCKFILE $commithash;
> +    if (system(qw(git update-ref -m), "cvsserver ci",
> +	       "refs/heads/$state->{module}", $commithash, $parenthash)) {
> +	    $log->warn("update-ref for $state->{module} failed.");
> +	    print "error 1 Cannot commit -- update first\n";
> +	    exit;
> +    }
>
>      $updater->update();

Running the commit lockless makes it a little bit more likely that we'll fail the commit after all files have been sent. Some older CVS clients have broken error handling in the late stages of the commit, but we cannot really fix that - and such cvs clients are so broken that they probably don't deserve our attention.

The other area I checked is that we don't get a nasty race condition between the update-ref and calling $updater->update() - but it is safe.

So ack from this corner and thanks for the patch!
cheers,
martin
-- 
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224  UK: 0845 868 5733 ext 7224  MOB: +64(21)364-017
      Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------
Previous: Andy ParkinsNext: Linus Torvalds
Message 16 of 39 in “Unresolved issues”
  1. Junio C HamanoFeb 20, 2007
  2. Andy ParkinsFeb 20, 2007
  3. Use git-update-ref to update a ref during commit in git-cvsserverAndy Parkins, Feb 20, 2007
  4. Nicolas PitreFeb 20, 2007
  5. Junio C HamanoFeb 21, 2007
  6. Andy ParkinsFeb 21, 2007
  7. 1/2 Make 'cvs ci' lockless in git-cvsserver by using git-update-refAndy Parkins, Feb 27, 2007
  8. Jakub NarebskiFeb 27, 2007
  9. Nicolas PitreFeb 27, 2007
  10. Junio C HamanoFeb 27, 2007
  11. Andy ParkinsFeb 28, 2007
  12. Junio C HamanoFeb 28, 2007
  13. 2/2 cvsserver: Remove trailing "\n" from commithash in checkin functionAndy Parkins, Feb 27, 2007
  14. Junio C HamanoFeb 27, 2007
  15. Andy ParkinsFeb 28, 2007
  16. Martin LanghoffFeb 27, 2007
  17. Linus TorvaldsFeb 20, 2007
  18. Junio C HamanoFeb 20, 2007
  19. Linus TorvaldsFeb 21, 2007
  20. Junio C HamanoFeb 21, 2007
  21. Johannes SchindelinFeb 21, 2007
  22. Linus TorvaldsFeb 21, 2007
  23. David LangFeb 21, 2007
  24. Johannes SchindelinFeb 21, 2007
  25. Nicolas PitreFeb 21, 2007
  26. Linus TorvaldsFeb 21, 2007
  27. Robin RosenbergFeb 21, 2007
  28. Theodore TsoFeb 21, 2007
  29. Martin WaitzFeb 21, 2007
  30. Johannes SchindelinFeb 21, 2007
  31. Brian GernhardtFeb 21, 2007
  32. Shawn O. PearceFeb 21, 2007
  33. git-status: do not be totally useless in a read-only repository.Junio C Hamano, Feb 22, 2007
  34. update-index: do not die too early in a read-only repository.Junio C Hamano, Feb 22, 2007
  35. Julian PhillipsFeb 26, 2007
  36. Junio C HamanoFeb 26, 2007
  37. Julian PhillipsFeb 26, 2007
  38. Junio C HamanoFeb 26, 2007
  39. Johannes SchindelinFeb 27, 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.