Initial manually svn property setting support for git-svn
PATCH 1/1 Initial manually svn property setting support for git-svn
In reply to a message not in the archiveThis basically stores an attribute 'svn-properties' for each file that needs them changed, and then sets the properties when committing.
Issues remaining:
* The way it edits the .gitattributes file is suboptimal - it just appends to the end the latest version
* It could use the existing code to get the current svn properties to see if properties need to be changed; but this doesn't work on add
* It would be better to cache all the svn properties locally - this could be done automatically in .gitattributes but I'm not sure everyone would want this, etc
* No support for deleting properties
Usage is:
git svn propset PROPNAME PROPVALUE PATH
Added minimal documentation for git-svn propset
--- Documentation/git-svn.txt | 5 ++ git-svn.perl | 95 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 99 insertions(+), 1 deletions(-)
Quoted 1 line
From
521ed4fc7c877269fb029b9494ef57300c722a10Mon Sep 17 00:00:00 2001
From: David Fraser <[email protected]>
Date: Wed, 16 Sep 2009 13:28:00 +0200
Subject: [PATCH] Initial manually svn property setting support for git-svn.
This basically stores an attribute 'svn-properties' for each file that needs them changed, and then sets the properties when committing.
Issues remaining:
* The way it edits the .gitattributes file is suboptimal - it just appends to the end the latest version
* It could use the existing code to get the current svn properties to see if properties need to be changed; but this doesn't work on add
* It would be better to cache all the svn properties locally - this could be done automatically in .gitattributes but I'm not sure everyone would want this, etc
* No support for deleting properties
Usage is:
git svn propset PROPNAME PROPVALUE PATH
Added minimal documentation for git-svn propset
--- Documentation/git-svn.txt | 5 ++ git-svn.perl | 95 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 99 insertions(+), 1 deletions(-)
Documentation/git-svn.txt +5 -0
@@ -345,6 +345,11 @@ Any other arguments are passed directly to 'git log' Gets the Subversion property given as the first argument, for a file. A specific revision can be specified with -r/--revision. +'propset':: + Sets the Subversion property given as the first argument, to the value + given as the second argument, for files specifed as the remaining + arguments. The property will be sent with the next commit. + 'show-externals':: Shows the Subversion externals. Use -r/--revision to specify a specific revision.
git-svn.perl +94 -1
149 lines not on this page · raw message
Signature · 1 line
1.6.0.4
Quoted 11 lines · David Fraser
This basically stores an attribute 'svn-properties' for each file that needs them changed, and then sets the properties when committing.
Issues remaining:
* The way it edits the .gitattributes file is suboptimal - it just appends to the end the latest version
* It could use the existing code to get the current svn properties to see if properties need to be changed; but this doesn't work on add
* It would be better to cache all the svn properties locally - this could be done automatically in .gitattributes but I'm not sure everyone would want this, etc
* No support for deleting propertiesUsage is:
git svn propset PROPNAME PROPVALUE PATH
Quoted 8 lines
Added minimal documentation for git-svn propset
Signed-off-by David Fraser <[email protected]>---
Documentation/git-svn.txt | 5 ++
git-svn.perl | 95 ++++++++++++++++++++++++++++++++++++++++++++-2 files changed, 99 insertions(+), 1 deletions(-)
David, please read this, line 28:
http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/SubmittingPatches;h=76fc84d8780762e083cd4ca584b9d783b8c0cd81;hb=HEAD
Patches need to be send as plain text, not attached.
Quoted 2 lines · David Fraser
This basically stores an attribute 'svn-properties' for each file that needs them changed, and then sets the properties when committing.
Hi David,
Please wrap your commit messages and emails at 72 columns or less. All git svn code should be wrapped at 80 or less, too.
Quoted 3 lines
Issues remaining:
* The way it edits the .gitattributes file is suboptimal - it just appends to the end the latest version
Consider using $GIT_DIR/info/attributes or having an option to use that instead. Keeping a .gitattributes file in the git working tree but _out_ of SVN is important and required, but also difficult to get right.
There are users working on projects that frown upon using unsupported clients like git svn, and accidentally checking .gitattributes into the project would likely annoy non-git users. It's best to keep *.git* stuff outside of SVN projects unless they allow/want it.
But also you should not fail to consider the case that somebody else did intentionally commit .gitattributes into svn and you have little choice but to commit your modifications to .gitattributes. Things like maintaining a mapping between svn:ignore and .gitignore has never happened because of the corner cases that could pop up.
Quoted 6 lines
* It could use the existing code to get the current svn properties to see if properties need to be changed; but this doesn't work on add
* It would be better to cache all the svn properties locally - this could be done automatically in .gitattributes but I'm not sure everyone would want this, etc
It should be possible to infer/rebuild this by parsing unhandled.log files git svn generates by default. There are definitely people who don't want .gitattributes being written to automatically.
Quoted 1 line
* No support for deleting properties
What advantage(s) does having this feature in git svn this give over using:
svn prop(edit|set|del) ARGS $(git svn info --url)
In my experience, explicitly set properties are rarely-used so I need to be convinced it's worth supporting in the future.
Quoted 4 lines
Usage is:
git svn propset PROPNAME PROPVALUE PATHAdded minimal documentation for git-svn propset
We'll also need a test case to ensure it continues working as other changes get made and refactoring gets done.
git-svn.perl sub cmd_propget { · line 901
Quoted 3 lines
git-svn.perl +3
-0+sub check_attr +{ + my ($attr,$path) = @_;
Please use formatting consistent with the rest of the file. Always use tabs for indent here.
Quoted 1 line
+ if ( open my $fh, '-|', "git", "check-attr", $attr, "--", $path )
Consider command_output_pipe for better portability/consistency in Git.pm instead of open(my $fh, "-|", @args) which is Perl 5.8+-only.
Thanks for the effort and keep us informed of improvements you make.
Signature · 1 line
Eric Wong