git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-svn Rewrites Some Commits, but not All
@ 2014-04-28 19:26 Aaron Laws
  2014-04-29 22:04 ` Piotr Krukowiecki
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Laws @ 2014-04-28 19:26 UTC (permalink / raw
  To: git

Hello.

I've been using git-svn for some time now, and I'm very happy with it.
There is one thing that I'm wondering about, however.

The way I understand it, when `git svn dcommit` is run, new commits
are created (A' is created from A adding SVN information), then the
current branch is moved to point to A'. Why don't we move any other
refs that were pointing to A over to A' ? What would be the point of
continuing to point to A? I'm interested in looking into coding this
change to git-svn, but I would like to hear some feedback first.

If you understand what I'm saying, feel free to stop now, otherwise, a
more verbose explanation follows:

Consider the following workflow:

Create a local branch tracking a SVN branch (I'll call it "master")
On that branch, git checkout -b topic;
Do some work, and git commit;
git checkout master; git merge topic;
git log --oneline --decorate --graph topic master
Note that topic and master point to the same commit (it was a fast-forward)
git svn dcommit;
git log --oneline --decorate --graph topic master

Now we see that topic and master now point to different commits. git
svn rewrote the master commits to add information about where those
commits went in SVN (their rev number, the url, etc.).

I'm proposing that both master and topic should now be pointing to A'.
This would allow numerous things to happen automatically that are
pleasing, for instance:  git branch -d topic; should succeed rather
than warn about unmerged changes.

Thanks for listening; I look forward to hearing your thoughts.

In Christ,
Aaron Laws

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-svn Rewrites Some Commits, but not All
  2014-04-28 19:26 git-svn Rewrites Some Commits, but not All Aaron Laws
@ 2014-04-29 22:04 ` Piotr Krukowiecki
  2014-04-30  6:59   ` Eric Wong
  2014-05-01 12:52   ` Aaron Laws
  0 siblings, 2 replies; 4+ messages in thread
From: Piotr Krukowiecki @ 2014-04-29 22:04 UTC (permalink / raw
  To: Aaron Laws; +Cc: git, Eric Wong

On Mon, Apr 28, 2014 at 9:26 PM, Aaron Laws <dartme18@gmail.com> wrote:
> The way I understand it, when `git svn dcommit` is run, new commits
> are created (A' is created from A adding SVN information), then the
> current branch is moved to point to A'. Why don't we move any other
> refs that were pointing to A over to A' ? What would be the point of
> continuing to point to A? I'm interested in looking into coding this
> change to git-svn, but I would like to hear some feedback first.

Hi,

I think A' might not always be simply (A + SVN info). I think you can
dcommit when you're not up to date.  So A' will have a different
parent than A (will be automatically rebased on top of current branch
tip). Other refs pointing to A might be used as bookmarks, and moving
them from A to A' would be a significant change.

-- 
Piotr Krukowiecki

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-svn Rewrites Some Commits, but not All
  2014-04-29 22:04 ` Piotr Krukowiecki
@ 2014-04-30  6:59   ` Eric Wong
  2014-05-01 12:52   ` Aaron Laws
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Wong @ 2014-04-30  6:59 UTC (permalink / raw
  To: Piotr Krukowiecki; +Cc: Aaron Laws, git

Piotr Krukowiecki <piotr.krukowiecki@gmail.com> wrote:
> On Mon, Apr 28, 2014 at 9:26 PM, Aaron Laws <dartme18@gmail.com> wrote:
> > The way I understand it, when `git svn dcommit` is run, new commits
> > are created (A' is created from A adding SVN information), then the
> > current branch is moved to point to A'. Why don't we move any other
> > refs that were pointing to A over to A' ? What would be the point of
> > continuing to point to A? I'm interested in looking into coding this
> > change to git-svn, but I would like to hear some feedback first.
> 
> I think A' might not always be simply (A + SVN info). I think you can
> dcommit when you're not up to date.  So A' will have a different
> parent than A (will be automatically rebased on top of current branch
> tip). Other refs pointing to A might be used as bookmarks, and moving
> them from A to A' would be a significant change.

Right, I would not want "git rebase" (what dcommit uses internally)
to scan all the branches in my repository and try to update them
behind my back.  It's far too surprising and potentially dangerous.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git-svn Rewrites Some Commits, but not All
  2014-04-29 22:04 ` Piotr Krukowiecki
  2014-04-30  6:59   ` Eric Wong
@ 2014-05-01 12:52   ` Aaron Laws
  1 sibling, 0 replies; 4+ messages in thread
From: Aaron Laws @ 2014-05-01 12:52 UTC (permalink / raw
  To: Piotr Krukowiecki; +Cc: git, Eric Wong

Ah, I missed that dcommit entails a rebase. I thought it just
complained if one needed to take place, so I always do a rebase
"manually" before dcommit. I agree, and would not want my other refs
moved around if the change is that drastic.

The workaround is not so bad anyway: git reset on the left-behind
refs. Thanks for the replies!

In Christ,
Aaron Laws


On Tue, Apr 29, 2014 at 6:04 PM, Piotr Krukowiecki
<piotr.krukowiecki@gmail.com> wrote:
> On Mon, Apr 28, 2014 at 9:26 PM, Aaron Laws <dartme18@gmail.com> wrote:
>> The way I understand it, when `git svn dcommit` is run, new commits
>> are created (A' is created from A adding SVN information), then the
>> current branch is moved to point to A'. Why don't we move any other
>> refs that were pointing to A over to A' ? What would be the point of
>> continuing to point to A? I'm interested in looking into coding this
>> change to git-svn, but I would like to hear some feedback first.
>
> Hi,
>
> I think A' might not always be simply (A + SVN info). I think you can
> dcommit when you're not up to date.  So A' will have a different
> parent than A (will be automatically rebased on top of current branch
> tip). Other refs pointing to A might be used as bookmarks, and moving
> them from A to A' would be a significant change.
>
> --
> Piotr Krukowiecki

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-01 12:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 19:26 git-svn Rewrites Some Commits, but not All Aaron Laws
2014-04-29 22:04 ` Piotr Krukowiecki
2014-04-30  6:59   ` Eric Wong
2014-05-01 12:52   ` Aaron Laws

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).