{"thread":{"id":"5000","subject":"[PATCH] cvsserver: imitate git-update-ref when committing","startedAt":"2006-07-26T20:51:52Z","lastAt":"2006-07-27T08:53:11Z","messageCount":3,"participants":["Johannes Schindelin","Shawn Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"24163","messageId":"Pine.LNX.4.63.0607262249010.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5000","inReplyTo":null,"subject":"[PATCH] cvsserver: imitate git-update-ref when committing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-26T20:51:52Z","receivedAt":"2006-07-26T20:51:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\ngit-update-ref writes into the lockfile, and renames it afterwards. Like \ncommit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared \nsetups: every developer can have a different primary group; what matters \nis that $GIT_DIR/refs/heads has to be writable by a group you are in.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n git-cvsserver.perl |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/git-cvsserver.perl b/git-cvsserver.perl\nindex 1b70cd9..2c1b0c7 100755\n--- a/git-cvsserver.perl\n+++ b/git-cvsserver.perl\n@@ -1144,9 +1144,7 @@ sub req_ci\n         exit;\n     }\n \n-    open FILE, \">\", \"$ENV{GIT_DIR}refs/heads/$state->{module}\";\n-    print FILE $commithash;\n-    close FILE;\n+    print LOCKFILE $commithash;\n \n     $updater->update();\n \n@@ -1173,7 +1171,9 @@ sub req_ci\n     }\n \n     close LOCKFILE;\n-    unlink($lockfile);\n+    my $reffile = \"$ENV{GIT_DIR}refs/heads/$state->{module}\";\n+    unlink($reffile);\n+    rename($lockfile, $reffile);\n     chdir \"/\";\n \n     print \"ok\\n\";\n-- \n1.4.2.rc2.g2b3d-dirty\n"},{"id":"24179","messageId":"20060727002130.GA32492@spearce.org","threadId":"5000","inReplyTo":"Pine.LNX.4.63.0607262249010.29667@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] cvsserver: imitate git-update-ref when committing","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-07-27T00:21:30Z","receivedAt":"2006-07-27T00:21:30Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"You might want to also consider appending to the reflog, if it\nexists/is enabled.  I still need to get upload-pack to do this but it\nmay be useful for some heads for some people...  or maybe not.  :-)\n\nJohannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> git-update-ref writes into the lockfile, and renames it afterwards. Like \n> commit v1.3.0-rc3~22, it is not only cleaner, but also helps with shared \n> setups: every developer can have a different primary group; what matters \n> is that $GIT_DIR/refs/heads has to be writable by a group you are in.\n> \n> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> ---\n>  git-cvsserver.perl |    8 ++++----\n>  1 files changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/git-cvsserver.perl b/git-cvsserver.perl\n> index 1b70cd9..2c1b0c7 100755\n> --- a/git-cvsserver.perl\n> +++ b/git-cvsserver.perl\n> @@ -1144,9 +1144,7 @@ sub req_ci\n>          exit;\n>      }\n>  \n> -    open FILE, \">\", \"$ENV{GIT_DIR}refs/heads/$state->{module}\";\n> -    print FILE $commithash;\n> -    close FILE;\n> +    print LOCKFILE $commithash;\n>  \n>      $updater->update();\n>  \n> @@ -1173,7 +1171,9 @@ sub req_ci\n>      }\n>  \n>      close LOCKFILE;\n> -    unlink($lockfile);\n> +    my $reffile = \"$ENV{GIT_DIR}refs/heads/$state->{module}\";\n> +    unlink($reffile);\n> +    rename($lockfile, $reffile);\n>      chdir \"/\";\n>  \n>      print \"ok\\n\";\n> -- \n> 1.4.2.rc2.g2b3d-dirty\n\n-- \nShawn.\n"},{"id":"24185","messageId":"Pine.LNX.4.63.0607271052070.29667@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5000","inReplyTo":"20060727002130.GA32492@spearce.org","subject":"Re: [PATCH] cvsserver: imitate git-update-ref when committing","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-07-27T08:53:11Z","receivedAt":"2006-07-27T08:53:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 26 Jul 2006, Shawn Pearce wrote:\n\n> You might want to also consider appending to the reflog, if it exists/is \n> enabled.\n\nGiven that I do not use it, and do not really understand what it does, \nthis would be a bad idea ;-)\n\nCiao,\nDscho\n\nP.S.: How's your Java thing coming along?\n"}]}