From: David Chanters <david.chanters@googlemail.com>
To: git@vger.kernel.org
Subject: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?
Date: Sat, 15 Sep 2012 13:02:44 +0100 [thread overview]
Message-ID: <CACffvTp4qnHc3RHKDotEfvshVDqGtTX6eh6Fr-bmJSMUvTFN6g@mail.gmail.com> (raw)
Hi,
Earlier this month I asked how best to handle two branches without a
common ancestor to sync changes from one branch to another. Initially
I did this via the grafts mechanism, but this wasn't a "shared"
solution, in that the graft was local to my checkout of the repository
and no one else's.
I read on StackOverflow that git-replace can be used instead. Having read this:
http://stackoverflow.com/questions/3810348/setting-git-parent-pointer-to-a-different-parent
I followed the instructions to use git-replace. Have successfully
done that, I was then able to merge the two branches which didn't have
a common ancestor and have the correct commits on the branch I was
hoping for. AFAIAC, this worked fine.
But now I have some questions:
1. I thought the replace data in .git/refs/replace was published when
I did "git push" so that others could use this information as a
base-point, yet it seems not to be the case. How do I publish this?
2. If I do publish it, are there any caveats with that? i.e.,
because the replace data will likely point to a repo which in my
working checkout I added with "git-remote", is that going to be a
problem? I assume I can instruct people who care, to "git remote add
foo ...." and then treat master and foo/master as intended? i.e.,
foo/master will see commits on it over time which "master" won't have,
so "git checkout master && git merge foo/master" can always happen?
3. If it is possible to publish this replace data, is there anything
which needs to happen in .git/config either on the bare repo or local
checkouts?
What I'm aiming for now, in publishing this merge, is that if I can
publish the replace data, that people besides me, can clone the repo,
and the remote repo in place, and merge the branches as outlined in
question 2. What I also am unsure of is whether or not I have to
keep updating the replace refs each time I merge the branch?
TIA!
David
next reply other threads:[~2012-09-15 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-15 12:02 David Chanters [this message]
2012-09-15 17:21 ` Using git-replace in place of grafts -- and publishing .git/refs/replace between repos? Junio C Hamano
2012-09-15 21:49 ` David Chanters
2012-09-16 2:42 ` Christian Couder
2012-09-16 6:04 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACffvTp4qnHc3RHKDotEfvshVDqGtTX6eh6Fr-bmJSMUvTFN6g@mail.gmail.com \
--to=david.chanters@googlemail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).