proper way to merge?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the input, JohnFlux and Bryan.

Here's what I found worked.

First of all, the overall concept that changes to the repository are
never destructive (as long as you remember where you were) is
liberating.  It's beyond the confidence of an "undo" feature.  Really,
nothing I do can change any of the existing objects and their
interrelationship.  Using the reflog and lightweight tags, and the
feature that gitk still knows the nodes even after the labels move,
makes it easy to experiment on.

Basically, I cherry-picked the commits from "rel" to "dev" and fixed
them as I went.  Leaving it at that, I'd forever see duplicate commits
with the same comments but different actual commits, so things like "git
log here..there" will recognize the equality.

So, to make it look like I actually used the merge command, I did this:

1) I reset back to the original dev before my patching.  The default
reset, mixed, left the working tree unchanged and didn't do anything to
the index either.

2) git merge rel -s ours
That created a new node with the topology I wanted, but didn't actually
do anything.

3) add all the changed files, and "amend" the commit.


I suppose --no-commit would do the same thing as amending, but this way
I saw (in getk) that it really did what I wanted, instead of trusting
the multiple parentage to just be waiting somehow.

If keeping things in the working directory to carry between the steps
gives you the willies, remember that you can always reset --hard back to
where you were before doing (1).  Either because you tagged it just in
case, can find it using HEAD@{something}, or still see it on the screen
in gitk.

But, another approach would be to do the (fake) merge first, and then
keep amending it with the individual changes you pick from the other
branch.  I don't like that because the tree will show something that's
not true, until you are all done.  I want everything to be correct and
not lying if I get interrupted and leave it that way for a while.

Comments welcome.  I'm trying to get my act together before I start
evangelizing to the rest of the team.

--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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux