From: John Dlugosz <hidden> Date: 2016-06-15 22:46:18
I'm merging two branches: let's say "dev" is for development of future
releases, and "rel" is changes made to the current release for immediate
application. Now I want to bring the changes made in rel back to dev.
Rather than trying to merge it all at once, I'm applying the changes a
few at a time and making sure it still compiles as I go. Then,
git-reset and I have dev as my HEAD and the desired merge result in the
working tree.
Now, I want to introduce the proper commit node to show that this is the
graft. But, I don't want to be presented with all the differences that
I already resolved; I know what it should look like already. How do I
commit the current state of things and have it show up with both dev and
rel as parents? (then make that the new dev)
I'm also interesting in learning how to do it better next time. But I'm
doing the incremental merging now and need to know how to conclude it.
--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from any computer.
From: John Tapsell <hidden> Date: 2016-06-15 22:46:18
2009/2/27 John Dlugosz [off-list ref]:
I'm merging two branches: let's say "dev" is for development of future
releases, and "rel" is changes made to the current release for immediate
application. Now I want to bring the changes made in rel back to dev.
Rather than trying to merge it all at once, I'm applying the changes a
few at a time and making sure it still compiles as I go. Then,
git-reset and I have dev as my HEAD and the desired merge result in the
working tree.
Now, I want to introduce the proper commit node to show that this is the
graft. But, I don't want to be presented with all the differences that
I already resolved; I know what it should look like already. How do I
commit the current state of things and have it show up with both dev and
rel as parents? (then make that the new dev)
I'm also interesting in learning how to do it better next time. But I'm
doing the incremental merging now and need to know how to conclude it.
Instead of merge, I prefer to rebase. so:
git checkout dev
git rebase origin rel
This replays each commit made in 'dev' on top of release, letting you
fix each commit separately. It also means that when I commit to
release, the changes are a nice tree.
This only works if you have a relatively small number of changes. I
tried to rebase 50 patches from 'dev' to 'rel' where the patches
changed pretty much every file. It took all day to do. (But it was
still better than trying to merge, in my specific case)
JohnFlux
--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Feb 27, 2009 at 5:11 PM, John Dlugosz [off-list ref] wrote:
I'm merging two branches: let's say "dev" is for development of future
releases, and "rel" is changes made to the current release for immediate
application. Now I want to bring the changes made in rel back to dev.
Rather than trying to merge it all at once, I'm applying the changes a
few at a time and making sure it still compiles as I go. Then,
git-reset and I have dev as my HEAD and the desired merge result in the
working tree.
Now, I want to introduce the proper commit node to show that this is the
graft. But, I don't want to be presented with all the differences that
I already resolved; I know what it should look like already. How do I
commit the current state of things and have it show up with both dev and
rel as parents? (then make that the new dev)
I'm also interesting in learning how to do it better next time. But I'm
doing the incremental merging now and need to know how to conclude it.
So, if I understand correctly, you've manually applied (manually
applying diffs or something?) your changes from the release branch to
the dev branch, and now want to inform git of what happened?
If so, you could commit what you have now, use a graft to change its
parentage, then git-filter-branch to actually update the commit
object. Something like this, I believe:
git commit -m 'Merge .....'
echo '<full 40-character commit ID of the merge> <parent on the dev
branch> <parent on the release branch>' >> .git/info/grafts
git-filter-branch dev~..dev
## You can remove (that line from) .git/info/grafts now
In the future, you may want to perform this sort of incremental merge
by simply git merging intermediate revisions in the release branch.
From: John Dlugosz <hidden> Date: 2016-06-15 22:46:19
===Re:===
Instead of merge, I prefer to rebase. so:
git checkout dev
git rebase origin rel
This replays each commit made in 'dev' on top of release, letting you
fix each commit separately. It also means that when I commit to
release, the changes are a nice tree.
===end===
The reason I'm doing this -- why I took over maintenance of the repository -- is because I strenuously objected to his plan to "rebase". NO! Merge, don't rebase. Besides never rebasing published branches, in this case it works much better the other way around: dev made systemic changes, and rel is mostly patches and completely new pieces of code. After looking at what was in dev..rel and what was in rel..dev, I chose to start with dev and bring in the commits from rel in a controlled manner.
I think you are indicated that the rebase is easier because the merge is done one commit at a time rather than in one huge bang. I want to have that advantage and then some by picking related groups of commits and verifying that it still compiles before getting more, not even limited to the original order.
I'll post what I learned in a separate note.
--John
(excuse the footer; it's not my choice)
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
From: John Dlugosz <hidden> Date: 2016-06-15 22:46:19
===Re:===
So, if I understand correctly, you've manually applied (manually
applying diffs or something?) your changes from the release branch to
the dev branch, and now want to inform git of what happened?
If so, you could commit what you have now, use a graft to change its
parentage, then git-filter-branch to actually update the commit
object. Something like this, I believe:
git commit -m 'Merge .....'
echo '<full 40-character commit ID of the merge> <parent on the dev
branch> <parent on the release branch>' >> .git/info/grafts
git-filter-branch dev~..dev
## You can remove (that line from) .git/info/grafts now
In the future, you may want to perform this sort of incremental merge
by simply git merging intermediate revisions in the release branch.
===end===
That's very interesting. I did not find 'grafts' in the documentation,
but I looked for it now that I know about it. So you can add another
parent to the graph just by adding a line to that file. BTW,
filter-branch isn't available on msysgit. But leaving it in that grafts
file should be OK -- is that pushed/pulled with everything else?
--John
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from any computer.
From: John Tapsell <hidden> Date: 2016-06-15 22:46:19
2009/3/2 John Dlugosz [off-list ref]:
===Re:===
Instead of merge, I prefer to rebase. so:
git checkout dev
git rebase origin rel
This replays each commit made in 'dev' on top of release, letting you
fix each commit separately. It also means that when I commit to
release, the changes are a nice tree.
===end===
The reason I'm doing this -- why I took over maintenance of the repository -- is because I strenuously objected to his plan to "rebase". NO! Merge, don't rebase. Besides never rebasing published branches, in this case it works much better the other way around: dev made systemic changes, and rel is mostly patches and completely new pieces of code. After looking at what was in dev..rel and what was in rel..dev, I chose to start with dev and bring in the commits from rel in a controlled manner.
It depends on what you're doing :-) I find that if the branch is too
large to easily rebase, then it's probably too large entirely :)
Developers don't like master to change in large ways suddenly - makes
it hard for all the other branches.
It also makes it impossible to bisect, something that I find
essential. If you are combining two trees which are too big to easily
rebase, then there's a high chance that something will break either
due to their individual changes or because of a mistake while merging.
In such a case, it's then impossible to bisect to try to pinpoint the
actual problem.
It will be interesting to hear your view on merging vs rebasing after
a year or so of trying both.
John
From: Johannes Sixt <hidden> Date: 2016-06-15 22:46:19
John Dlugosz schrieb:
I did not find 'grafts' in the documentation,
but I looked for it now that I know about it. So you can add another
parent to the graph just by adding a line to that file. BTW,
filter-branch isn't available on msysgit.
Huh? filter-branch *is* in msysgit. Why do you think it is not?
But leaving it in that grafts
file should be OK -- is that pushed/pulled with everything else?
No.
You really want to use filter-branch if the new parent is to be permanent.
-- Hannes
From: John Dlugosz <hidden> Date: 2016-06-15 22:46:19
===Re:===
Huh? filter-branch *is* in msysgit. Why do you think it is not?
===end===
Because when I tried it I got " git: 'filter-branch' is not a
git-command. See 'git --help'."
Then I looked in the Git installation directory and did not find any
file with that name. Then I looked at the ReleaseNotes.rtf file in the
top of the Git installation tree and saw,
" * Some commands are not yet supported on Windows and excluded from
the installation; namely: git archimport, git cvsexportcommit, git
cvsimport, git cvsserver, git filter-branch, git instaweb, git
send-email, git shell, git svn."
So I wonder why you think it *is* in msysgit? This is the latest
version from their site.
--John
(please excuse the footer; it's not my idea)
TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender and delete the material from any computer.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:46:19
John Dlugosz schrieb:
" * Some commands are not yet supported on Windows and excluded from
the installation; namely: git archimport, git cvsexportcommit, git
cvsimport, git cvsserver, git filter-branch, git instaweb, git
send-email, git shell, git svn."
A-ha. If there ever was a reason to exclude filter-branch, then I think
this reason is no more.
So I wonder why you think it *is* in msysgit? This is the latest
version from their site.
Because I don't use the msysgit installer, but compile git myself. I have
a working filter-branch.
-- Hannes