[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Proposed workflow for proprietary repository
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] Proposed workflow for proprietary repository |
Date: |
Wed, 7 Aug 2019 21:56:13 +0200 |
On Tue, 6 Aug 2019 21:40:57 +0000 Greg Chicares <address@hidden> wrote:
GC> [not at all urgent--no speedy reply sought]
I'll use this as an excuse to postpone actually experimenting with what
I'm going to write, but perhaps I can suggest something that will work.
GC> But today I tried unsuccessfully to adapt it to an unusual situation:
GC> - I had shared two separate bundles of ten commits each
GC> - I also had four unpushed local commits
GC> - Kim thus had my HEAD~24..HEAD~4 as her HEAD~20..HEAD
GC> - She discovered a mistake in my HEAD~4 (her HEAD)
GC> - I had already fixed it in my HEAD~3, which I hadn't shared
GC> Therefore, I wanted to send a new bundle that would bring her working
GC> copy from my (broken) HEAD~4 to my (correct) HEAD~3, preferably without
GC> sending my three other unpushed commits at the same time. I tried using
GC> the same trusty command quoted above, but with the refspec changed thus:
GC> - origin/master..HEAD
GC> + origin/master..HEAD~3
GC> and it seemed to work, except that I couldn't pull it myself:
I think the bundle does contain the right commits (which, in this case, is
just HEAD~3), but it doesn't contain the HEAD reference because you didn't
put it there. To fix this, I see 2 possibilities:
First one, which I'm almost sure is going to work: just create a temporary
branch and switch your HEAD (== pointer to the commit currently checked
out) to it, e.g.:
git checkout -b tmp-branch HEAD~3
Then you can follow the usual procedure without any changes and, at the
end, you can just
git checkout master
git branch -d tmp-branch
Second one, requiring less steps, could be to just create a branch without
switching to it:
git branch some-good-name HEAD~3
and then use it when creating the bundle:
git bundle create /opt/lmi/blessed/$(date -u
+'%Y%m%dT%H%MZ')-gwc.bundle origin/master..some-good-name --branches
I am not sure if this is enough to allow you to do
git pull --dry-run /opt/lmi/blessed/20190806T1710Z-gwc.bundle
successfully later, but it might be and, of not, I'm almost sure that doing
git fetch /opt/lmi/blessed/20190806T1710Z-gwc.bundle some-good-name
should work and fetch the reference to this branch to FETCH_HEAD, so that
you could use it as usual later, e.g.
git merge --ff-only FETCH_HEAD
to fast-forward your local HEAD to FETCH_HEAD.
I also wonder why do we use --branches in the first place, it looks like
--branches=master should be enough -- and take quite a bit less space if
you have any other branches which are not needed by the recipient.
Regards,
VZ
pgp379SIrFJOe.pgp
Description: PGP signature