Skip to contentSkip to conversation

git svn --add-author-from implies --use-log-author

PATCH New Fredrik Skolmli 3 participants 7 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

Hi,

when running git svn dcommit --add-author-from on a git-svn repository, --use-log-author is not implied by itself. This causes the rewritten history to not show the author in the way most users would expect it to be, "Name <[email protected]>", but instead "<user@uuid>".

Instead of forcing people to write "svn dcommit --add-author-from --use-log-author", is it a bad move to imply the last argument, making the history look more user-friendly to start with?

Any thoughts?

Signature · 2 lines
Regards,
Fredrik Skolmli
#1 lore raw

Hi,

Quoted 8 lines · Fredrik Skolmli

when running git svn dcommit --add-author-from on a git-svn repository, --use-log-author is not implied by itself. This causes the rewritten history to not show the author in the way most users would expect it to be, "Name <[email protected]>", but instead "<user@uuid>".

Instead of forcing people to write "svn dcommit --add-author-from --use-log-author", is it a bad move to imply the last argument, making the history look more user-friendly to start with?

The documentation mentions that these 2 parameters are for init and, like other parameters, I had the feeling they will affect either the "init" process or the entire existance of the repository. Now that I look better, I see that there is no "config" note next to them.

From my point of view, they should be repository config options, affecting all commits. I can't see a reason for having only sometimes
--add-author-from. If you want to commit information about the authors in regards to a SVN repository, you'll always want that option to be on. If you want to have authors properly identified when getting something out of the SVN repository, you'll always want to have --use-log-author on.

I would also like some option to stop pushing a commit if it doesn't have any From/Signed-off-by line in it.

Mircea

P.S. I am very curious why using From and not Signed-off-by. I had the feeling that Signed-off-by is being used to also mark the path of a patch. Also, is there a centralized list of all the ways a patch can be "marked"

--
http://mircea.bardac.net

#2 lore raw
Quoted 5 lines · Mircea Bardac
Quoted 5 lines

when running git svn dcommit --add-author-from on a git-svn repository, --use-log-author is not implied by itself. This causes the rewritten history to not show the author in the way most users would expect it to be, "Name <[email protected]>", but instead "<user@uuid>".

Quoted 8 lines
Quoted 3 lines

Instead of forcing people to write "svn dcommit --add-author-from --use-log-author", is it a bad move to imply the last argument, making the history look more user-friendly to start with?

The documentation mentions that these 2 parameters are for init and, like
other parameters, I had the feeling they will affect either the "init" process or the entire existance of the repository. Now that I look better, I see that there is no "config" note next to them.

They are separate options; --add-author-from affects dcommit (but not fetch or clone), while --use-log-author affects fetch and clone (but not dcommit). They do different things, and I can imagine wanting one and not the other, so having one imply the other isn't very safe.

You can set config options for these, however:

git config svn.addAuthorFrom true
git config svn.useLogAuthor true

(I actually use "git config --global" to set these on my system so they apply to all my git-svn repositories.)

Quoted 2 lines

I would also like some option to stop pushing a commit if it doesn't have
any From/Signed-off-by line in it.

[...]

Quoted 3 lines

P.S. I am very curious why using From and not Signed-off-by. I had the
feeling that Signed-off-by is being used to also mark the path of a patch. Also, is there a centralized list of all the ways a patch can be "marked"

Signed-off-by is a legal declaration. Please read the documentation carefully before using it.

From: is automatically added (when you enable the option and there's no Signed-off-by or From already) and is just informational.

Have fun,

Avery

#3 lore raw
Quoted 4 lines · Avery Pennarun

They are separate options; --add-author-from affects dcommit (but not fetch or clone), while --use-log-author affects fetch and clone (but not dcommit). They do different things, and I can imagine wanting one and not the other, so having one imply the other isn't very safe.

No, I agree implying it isn't safe. The need for implying --use-log-author when doing --add-author-from might just be me being to lazy to remember both flags. :-)

Quoted 7 lines

You can set config options for these, however:

git config svn.addAuthorFrom true
git config svn.useLogAuthor true

(I actually use "git config --global" to set these on my system so they apply to all my git-svn repositories.)

Hm, I did not know about these config options. Are they documented somewhere?

- F

Signature · 2 lines
Regards,
Fredrik Skolmli
#4 lore raw

PATCH 1/1 git-svn docs: mention svn.addAuthorFrom and svn.useLogAuthor config options.

At least one person got confused because they thought it was necessary to provide these on the command line every time.

---
 Documentation/git-svn.txt |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
Documentation/git-svn.txt +6 -3
index 97bed54..e8200ce 100644
@@ -64,13 +64,16 @@ COMMANDS
 --use-log-author;;
 	When retrieving svn commits into git (as part of fetch, rebase, or
 	dcommit operations), look for the first From: or Signed-off-by: line
-	in the log message and use that as the author string.
+	in the log message and use that as the author string. (To enable
+	this permanently, use git config svn.useLogAuthor)
 --add-author-from;;
 	When committing to svn from git (as part of commit or dcommit
 	operations), if the existing log message doesn't already have a
 	From: or Signed-off-by: line, append a From: line based on the
-	git commit's author string.  If you use this, then --use-log-author
-	will retrieve a valid author string for all commits.
+	git commit's author string.  If you use this, then if you enable
+	--use-log-author it will retrieve a valid author string for all
+	commits. (To enable this option permanently, use git config
+	svn.addAuthorFrom)
 --username=<USER>;;
 	For transports that SVN handles authentication for (http,
 	https, and plain svn), specify the username.  For other
Signature · 1 line
1.5.6.56.g29b0d
#5 lore raw
In reply to Avery Pennarun
Quoted 7 lines · Avery Pennarun

You can set config options for these, however:

git config svn.addAuthorFrom true
git config svn.useLogAuthor true

(I actually use "git config --global" to set these on my system so they apply to all my git-svn repositories.)

Oh great. This is what I actually wanted. Makes a lot more sense to have them as (global) variables.

My initial thought was that there are (somewhere) some variables being set for the repository by using --add-author-from and --use-log-author with "git svn clone ...". I find this quite intuitive (and maybe this should be default?). I can't see a reason for using these options once and not using them later, but it might just be me.

Quoted 9 lines
Quoted 3 lines

P.S. I am very curious why using From and not Signed-off-by. I had the
feeling that Signed-off-by is being used to also mark the path of a patch. Also, is there a centralized list of all the ways a patch can be "marked"

Signed-off-by is a legal declaration. Please read the documentation carefully before using it.

From: is automatically added (when you enable the option and there's no Signed-off-by or From already) and is just informational.

I have found that Documentation/SubmittingPatches contains info on how to use "Signed-off-by:"/"Acked-by:"/a little bit of "From:" but, as far as I remember, others have been/are used. Are they all gathered somewhere, as recommendations?

Many thanks.

Signature · 2 lines
Mircea
http://mircea.bardac.net
#6 lore raw
Quoted 10 lines · Mircea Bardac
Quoted 7 lines · Avery Pennarun

You can set config options for these, however:

git config svn.addAuthorFrom true
git config svn.useLogAuthor true

(I actually use "git config --global" to set these on my system so they apply to all my git-svn repositories.)

Quoted 8 lines

Oh great. This is what I actually wanted. Makes a lot more sense to have
them as (global) variables.

My initial thought was that there are (somewhere) some variables being set
for the repository by using --add-author-from and --use-log-author with "git svn clone ...". I find this quite intuitive (and maybe this should be default?). I can't see a reason for using these options once and not using them later, but it might just be me.

I agree, it's a good idea to save them to the config at git svn clone time.

When I added --add-author-from I just did it like --use-log-author, then I had to read the source code to find out how to set them as config variables :)

I'm sure some patches (at least for the documentation) would be welcomed.

Quoted 4 lines

I have found that Documentation/SubmittingPatches contains info on how to
use "Signed-off-by:"/"Acked-by:"/a little bit of "From:" but, as far as I remember, others have been/are used. Are they all gathered somewhere, as recommendations?

I don't know of any definitive reference, but Signed-off-by and Acked-by seem to be the important ones. From: (as part of the commit message) seems to be a git-svn extension that I invented. From: (as a header in the commit message) is interpreted as the committer name by git-am, I think, but you almost never need that.

Have fun,

Avery