threads / discuss / 9433

git-svn: commit author x commit committer issue

Subject: git-svn: commit author x commit committer issue

## tl;dr

12 messages between Aug 8, 2007 and Aug 23, 2007.

replies: 11people: 6as markdown or json

Richard MUSIL· Aug 8, 2007, 13:46 UTC · lore

Normally, when patch is applied, git distinguishes commit author and commit committer (relying on info from patch). However, after the patches are committed to svn repository using: git-svn dcommit author and committer data are set to same values (or at least time and date, I cannot verify it for names). I wonder if there is any reason for this behavior, because I would definitely like to keep original commit info (which came from patch) in my git repository.

Richard Musil (please cc: me)

Quy Tonthat· Aug 8, 2007, 15:42 UTC · re: Richard MUSIL · lore

Re: git-svn: commit author x commit committer issue

Richard MUSIL wrote:
Show 9 quoted lines
> Normally, when patch is applied, git distinguishes commit author and
> commit committer (relying on info from patch).
> However, after the patches are committed to svn repository using:
> git-svn dcommit
> author and committer data are set to same values (or at least time and
> date, I cannot verify it for names).
> I wonder if there is any reason for this behavior, because I would
> definitely like to keep original commit info (which came from patch) in
> my git repository.

I'm sure this worked before (author and committee are different, that is). Something went wrong recently but I haven't got time to look into the problem. I hope someone would.

Quy
Peter Baumann· Aug 8, 2007, 17:13 UTC · re: Richard MUSIL · lore

Re: git-svn: commit author x commit committer issue

On Wed, Aug 08, 2007 at 03:46:19PM +0200, Richard MUSIL wrote:
Show 9 quoted lines
> Normally, when patch is applied, git distinguishes commit author and
> commit committer (relying on info from patch).
> However, after the patches are committed to svn repository using:
> git-svn dcommit
> author and committer data are set to same values (or at least time and
> date, I cannot verify it for names).
> I wonder if there is any reason for this behavior, because I would
> definitely like to keep original commit info (which came from patch) in
> my git repository.

I think it is because in SVN, you can't differentiate between author and committer. And git-svn just commits every local commit to svn, and after that, it throws away your local commits and uses the info from the reimported svn commits to recreate those thrown away commits. Thats why you loose your author name and also your commit date.

Ok, this was a little too simplified, but describes roughly what happens if you dcommit your changes.

-Peter
Richard MUSIL· Aug 9, 2007, 09:45 UTC · re: Peter Baumann · lore

Re: git-svn: commit author x commit committer issue

Peter Baumann wrote:
Show 16 quoted lines
> On Wed, Aug 08, 2007 at 03:46:19PM +0200, Richard MUSIL wrote:
>> Normally, when patch is applied, git distinguishes commit author and
>> commit committer (relying on info from patch).
>> However, after the patches are committed to svn repository using:
>> git-svn dcommit
>> author and committer data are set to same values (or at least time and
>> date, I cannot verify it for names).
>> I wonder if there is any reason for this behavior, because I would
>> definitely like to keep original commit info (which came from patch) in
>> my git repository.
> 
> I think it is because in SVN, you can't differentiate between author and
> committer. And git-svn just commits every local commit to svn, and after
> that, it throws away your local commits and uses the info from the
> reimported svn commits to recreate those thrown away commits. Thats why
> you loose your author name and also your commit date.

I guess you are right. I have been thinking about the possibility to store the original author and patch date into svn unversioned property. Something like git:author and git:date. There is however one catch. Modifying unversioned properties must be explicitly allowed on svn repository, so this will have to be optional in git (svn.userevprops ?).

I do not know what others think about this. For me it seems quite attractive, to be able to store development history of original actions inside svn, especially when the case might be that commits into git happen at different time on different machines and by different people than the final commit to svn.

I have been trying to find out how this works in git-svn, but since Perl is worse than Greek to me, I found out only that I am not able to do anything here. Would anyone be interested to work on it?

Richard
Eric Wong· Aug 16, 2007, 09:20 UTC · re: Richard MUSIL · lore

Re: git-svn: commit author x commit committer issue

Richard MUSIL <richard.musil@st.com> wrote:
Show 9 quoted lines
> Normally, when patch is applied, git distinguishes commit author and
> commit committer (relying on info from patch).
> However, after the patches are committed to svn repository using:
> git-svn dcommit
> author and committer data are set to same values (or at least time and
> date, I cannot verify it for names).
> I wonder if there is any reason for this behavior, because I would
> definitely like to keep original commit info (which came from patch) in
> my git repository.

I try to keep commits made to SVN using git-svn as much like commits made using other SVN clients as much as possible.

Two people using git-svn (in its recommended fashion and maintaining linear history) can have identical SHA1s in their repository even if those two repositories had never seen each other before. Consistency is good.

I also want to avoid creating extra junk on the SVN repository which I don't personally consider very important. SVK does stuff like that with merges, and only SVK understands the metadata it uses. I prefer transparency.

-- 
Eric Wong
Richard MUSIL· Aug 16, 2007, 12:13 UTC · re: Eric Wong · lore

Re: git-svn: commit author x commit committer issue

Eric Wong wrote:
Show 18 quoted lines
> Richard MUSIL <richard.musil@st.com> wrote:
>> Normally, when patch is applied, git distinguishes commit author and
>> commit committer (relying on info from patch).
>> However, after the patches are committed to svn repository using:
>> git-svn dcommit
>> author and committer data are set to same values (or at least time and
>> date, I cannot verify it for names).
>> I wonder if there is any reason for this behavior, because I would
>> definitely like to keep original commit info (which came from patch) in
>> my git repository.
> 
> I try to keep commits made to SVN using git-svn as much like commits
> made using other SVN clients as much as possible.
> 
> Two people using git-svn (in its recommended fashion and maintaining
> linear history) can have identical SHA1s in their repository even if
> those two repositories had never seen each other before.  Consistency
> is good.

Ok, if I understand well, you are saying, that if someone commits with distinguished author/committer and someone does not, they end up with different SHA1s because those parts affect the calculation. I agree this could be a breaking point.

> I also want to avoid creating extra junk on the SVN repository which I
> don't personally consider very important.  SVK does stuff like that with
> merges, and only SVK understands the metadata it uses.  I prefer
> transparency.

I made some suggestions in this thread about using revision (unversioned) property of SVN fot git "metadata". AFAIK using rev. props is completely transparent to other SVN clients (in this case those not being git-svn), so they could easily ignore them.

It could be optional on git config property for commit and autodetected for clone/pull.

The scenario I could easily imagine (though it is not something I am currently using) is having dev teams using git internally (because its much easier for tracking local development) and having SVN repo as a "central hub". In such environment, there will be probably one person in each team (dev. lead) collecting commits from others and once things are set, he will commit all changes to svn. In that particular case, he does not have to worry about different sha1s, because they use only one SVN (as it was meant to be used). But he could be sad about losing all authors info about the people commits. And my personal believe is, this is how git-svn may enter svn world on big projects.

But you are right, it is up to you to decide. It was just an idea ;-).
Richard
Eric Wong· Aug 17, 2007, 07:58 UTC · re: Richard MUSIL · lore

Re: git-svn: commit author x commit committer issue

Richard MUSIL <richard.musil@st.com> wrote:
Show 27 quoted lines
> Eric Wong wrote:
> > Richard MUSIL <richard.musil@st.com> wrote:
> > I also want to avoid creating extra junk on the SVN repository which I
> > don't personally consider very important.  SVK does stuff like that with
> > merges, and only SVK understands the metadata it uses.  I prefer
> > transparency.
> 
> I made some suggestions in this thread about using revision
> (unversioned) property of SVN fot git "metadata". AFAIK using rev. props
> is completely transparent to other SVN clients (in this case those not
> being git-svn), so they could easily ignore them.
> 
> It could be optional on git config property for commit and autodetected
> for clone/pull.
> 
> The scenario I could easily imagine (though it is not something I am
> currently using) is having dev teams using git internally (because its
> much easier for tracking local development) and having SVN repo as a
> "central hub". In such environment, there will be probably one person in
> each team (dev. lead) collecting commits from others and once things are
> set, he will commit all changes to svn. In that particular case, he does
> not have to worry about different sha1s, because they use only one SVN
> (as it was meant to be used). But he could be sad about losing all
> authors info about the people commits. And my personal believe is, this
> is how git-svn may enter svn world on big projects.
> 
> But you are right, it is up to you to decide. It was just an idea ;-).

It'd be easy for git-svn to write metadata to rev-props. Whether or not it reads and does anything with them is another issue... I think Sam was working on something that allowed it to track merges on the git-side, but we'd be introducing a third or fourth method of non-standard merge-tracking into SVN :)

In any case, this behavior should always be optional and off by default.
-- 
Eric Wong
Guilhem Bonnefille· Aug 22, 2007, 10:07 UTC · re: Eric Wong · lore

Re: git-svn: commit author x commit committer issue

On 8/16/07, Eric Wong <normalperson@yhbt.net> wrote:
Show 23 quoted lines
> Richard MUSIL <richard.musil@st.com> wrote:
> > Normally, when patch is applied, git distinguishes commit author and
> > commit committer (relying on info from patch).
> > However, after the patches are committed to svn repository using:
> > git-svn dcommit
> > author and committer data are set to same values (or at least time and
> > date, I cannot verify it for names).
> > I wonder if there is any reason for this behavior, because I would
> > definitely like to keep original commit info (which came from patch) in
> > my git repository.
>
> I try to keep commits made to SVN using git-svn as much like commits
> made using other SVN clients as much as possible.
>
> Two people using git-svn (in its recommended fashion and maintaining
> linear history) can have identical SHA1s in their repository even if
> those two repositories had never seen each other before.  Consistency
> is good.
>
> I also want to avoid creating extra junk on the SVN repository which I
> don't personally consider very important.  SVK does stuff like that with
> merges, and only SVK understands the metadata it uses.  I prefer
> transparency.

Instead of using SVN metadata, why not store the missing information like git-svn store the SVN rev id. (in the commit log as I know).

-- 
Guilhem BONNEFILLE
-=- #UIN: 15146515 JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/
Guilhem Bonnefille· Aug 22, 2007, 10:17 UTC · re: Guilhem Bonnefille · lore

Re: git-svn: commit author x commit committer issue

Oops, sory, I'm completly wrong: the git-svn-id is put on the commit log in the Git repo, not on the SVN repo. Please, ignore me.

On 8/22/07, Guilhem Bonnefille <guilhem.bonnefille@gmail.com> wrote:
Show 34 quoted lines
> On 8/16/07, Eric Wong <normalperson@yhbt.net> wrote:
> > Richard MUSIL <richard.musil@st.com> wrote:
> > > Normally, when patch is applied, git distinguishes commit author and
> > > commit committer (relying on info from patch).
> > > However, after the patches are committed to svn repository using:
> > > git-svn dcommit
> > > author and committer data are set to same values (or at least time and
> > > date, I cannot verify it for names).
> > > I wonder if there is any reason for this behavior, because I would
> > > definitely like to keep original commit info (which came from patch) in
> > > my git repository.
> >
> > I try to keep commits made to SVN using git-svn as much like commits
> > made using other SVN clients as much as possible.
> >
> > Two people using git-svn (in its recommended fashion and maintaining
> > linear history) can have identical SHA1s in their repository even if
> > those two repositories had never seen each other before.  Consistency
> > is good.
> >
> > I also want to avoid creating extra junk on the SVN repository which I
> > don't personally consider very important.  SVK does stuff like that with
> > merges, and only SVK understands the metadata it uses.  I prefer
> > transparency.
>
> Instead of using SVN metadata, why not store the missing information
> like git-svn store the SVN rev id. (in the commit log as I know).
>
> --
> Guilhem BONNEFILLE
> -=- #UIN: 15146515 JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
> -=- mailto:guilhem.bonnefille@gmail.com
> -=- http://nathguil.free.fr/
>
-- 
Guilhem BONNEFILLE
-=- #UIN: 15146515 JID: guyou@im.apinc.org MSN: guilhem_bonnefille@hotmail.com
-=- mailto:guilhem.bonnefille@gmail.com
-=- http://nathguil.free.fr/
Junio C Hamano· Aug 22, 2007, 21:34 UTC · re: Guilhem Bonnefille · lore

Re: git-svn: commit author x commit committer issue

"Guilhem Bonnefille" <guilhem.bonnefille@gmail.com> writes:
> Oops, sory, I'm completly wrong: the git-svn-id is put on the commit
> log in the Git repo, not on the SVN repo.
> Please, ignore me.

I do not think it is wrong to tack that to the commit message you push it back to SVN... am I missing something?

Eric Wong· Aug 23, 2007, 05:05 UTC · re: Junio C Hamano · lore

Re: git-svn: commit author x commit committer issue

Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> "Guilhem Bonnefille" <guilhem.bonnefille@gmail.com> writes:
> 
> > Oops, sory, I'm completly wrong: the git-svn-id is put on the commit
> > log in the Git repo, not on the SVN repo.
> > Please, ignore me.
> 
> I do not think it is wrong to tack that to the commit message
> you push it back to SVN... am I missing something?

It's actually possible to add a revprop in SVN that is not immediately visible to SVN users.

-- 
Eric Wong
Richard MUSIL· Aug 23, 2007, 08:51 UTC · re: Eric Wong · lore

Re: git-svn: commit author x commit committer issue

Eric Wong wrote:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
>> "Guilhem Bonnefille" <guilhem.bonnefille@gmail.com> writes:
>>
>>> Oops, sory, I'm completly wrong: the git-svn-id is put on the commit
>>> log in the Git repo, not on the SVN repo.
>>> Please, ignore me.
>> I do not think it is wrong to tack that to the commit message
>> you push it back to SVN... am I missing something?
> 
> It's actually possible to add a revprop in SVN that is not immediately
> visible to SVN users.

I would say revprops would be great, but as of now, they are not by default available on svn repo. Which makes their usage only optional for git. (But for author info I believe this is acceptable.)

Richard

← back to recent threads