threads / discuss / 14058

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

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

## tl;dr

7 messages between Jun 20, 2008 and Jun 24, 2008.

replies: 6people: 3as markdown or json

Fredrik Skolmli· Jun 20, 2008, 11:31 UTC · lore
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@domain.tld>", 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?
-- 
Regards,
Fredrik Skolmli
Mircea Bardac· Jun 20, 2008, 13:31 UTC · re: Fredrik Skolmli · lore

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

Hi,
Fredrik Skolmli wrote:
Show 8 quoted 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@domain.tld>", 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

Avery Pennarun· Jun 23, 2008, 20:12 UTC · re: Mircea Bardac · lore

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

On 6/20/08, Mircea Bardac <dev@mircea.bardac.net> wrote:
Show 13 quoted 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@domain.tld>", 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.

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.)

>  I would also like some option to stop pushing a commit if it doesn't have
> any From/Signed-off-by line in it.
[...]
>  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
Mircea Bardac· Jun 23, 2008, 21:22 UTC · re: Avery Pennarun · lore

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

Avery Pennarun wrote:
Show 7 quoted 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.)

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.

Show 9 quoted 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.
-- 
Mircea
http://mircea.bardac.net
Avery Pennarun· Jun 23, 2008, 21:31 UTC · re: Mircea Bardac · lore

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

On 6/23/08, Mircea Bardac <dev@mircea.bardac.net> wrote:
Show 18 quoted lines
>  Avery Pennarun wrote:
>
> > 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.
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.
>  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
Fredrik Skolmli· Jun 24, 2008, 07:37 UTC · re: Avery Pennarun · lore

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

On Mon, Jun 23, 2008 at 04:12:37PM -0400, Avery Pennarun wrote:
> 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. :-)

Show 7 quoted 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
-- 
Regards,
Fredrik Skolmli
Avery Pennarun· Jun 24, 2008, 16:02 UTC · re: Fredrik Skolmli · lore

[PATCH] 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.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
---
 Documentation/git-svn.txt |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 97bed54..e8200ce 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -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
-- 
1.5.6.56.g29b0d

← back to recent threads