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

Re: [PATCH] cvsserver: imitate git-update-ref when committing

From
Shawn Pearce <spearce@spearce.org>
Date
Jul 27, 2006, 00:21 UTC
Message-ID
<20060727002130.GA32492@spearce.org>
In-Reply-To
<Pine.LNX.4.63.0607262249010.29667@wbgn013.biozentrum.uni-wuerzburg.de>

You might want to also consider appending to the reflog, if it exists/is enabled. I still need to get upload-pack to do this but it may be useful for some heads for some people... or maybe not. :-)

Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 39 quoted lines
> 
> git-update-ref writes into the lockfile, and renames it afterwards. Like 
> commit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared 
> setups: every developer can have a different primary group; what matters 
> is that $GIT_DIR/refs/heads has to be writable by a group you are in.
> 
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> ---
>  git-cvsserver.perl |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/git-cvsserver.perl b/git-cvsserver.perl
> index 1b70cd9..2c1b0c7 100755
> --- a/git-cvsserver.perl
> +++ b/git-cvsserver.perl
> @@ -1144,9 +1144,7 @@ sub req_ci
>          exit;
>      }
>  
> -    open FILE, ">", "$ENV{GIT_DIR}refs/heads/$state->{module}";
> -    print FILE $commithash;
> -    close FILE;
> +    print LOCKFILE $commithash;
>  
>      $updater->update();
>  
> @@ -1173,7 +1171,9 @@ sub req_ci
>      }
>  
>      close LOCKFILE;
> -    unlink($lockfile);
> +    my $reffile = "$ENV{GIT_DIR}refs/heads/$state->{module}";
> +    unlink($reffile);
> +    rename($lockfile, $reffile);
>      chdir "/";
>  
>      print "ok\n";
> -- 
> 1.4.2.rc2.g2b3d-dirty
-- 
Shawn.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 2 of 3 in “cvsserver: imitate git-update-ref when committing”
  1. cvsserver: imitate git-update-ref when committingJohannes Schindelin, Jul 26, 2006
  2. Shawn PearceJul 27, 2006
  3. Johannes SchindelinJul 27, 2006

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.