From: Shawn Pearce <spearce@spearce.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] cvsserver: imitate git-update-ref when committing
Date: Wed, 26 Jul 2006 20:21:30 -0400 [thread overview]
Message-ID: <20060727002130.GA32492@spearce.org> (raw)
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:
>
> 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.
next prev parent reply other threads:[~2006-07-27 0:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-26 20:51 [PATCH] cvsserver: imitate git-update-ref when committing Johannes Schindelin
2006-07-27 0:21 ` Shawn Pearce [this message]
2006-07-27 8:53 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060727002130.GA32492@spearce.org \
--to=spearce@spearce.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).