[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Proposed workflow for proprietary repository
From: |
Greg Chicares |
Subject: |
Re: [lmi] Proposed workflow for proprietary repository |
Date: |
Wed, 16 Mar 2016 14:48:17 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 |
On 2016-03-07 18:34, Vadim Zeitlin wrote:
> On Mon, 7 Mar 2016 18:15:33 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> [Ideally, we would like to have a command to apply patches safely.
>
> I'm afraid patches are just not meant to be used like this, they're, by
> design, supposed to be applicable to (slightly) different versions of the
> original sources than the one they were originally made against. I hesitate
> to say this after all the time you've already spent devising this workflow,
> especially because I think it should work perfectly well in practice, but I
> think git bundles fit your needs better.
### WORKFLOW WITH GIT BUNDLES
# Reference:
#
http://stackoverflow.com/questions/3635952/how-to-use-git-bundle-for-keeping-development-in-sync
# you can add a bundle as a remote, and interact with it just as you
# would with any other remote. To update that remote, just drop in a
# new bundle, replacing the previous one.
# Suppose we have only two users, Kim and Greg. For this
# demonstration, simulate two separate machines in /tmp :
# Wipe any previous run clean
cd /tmp
rm -rf /tmp/kim
rm -rf /tmp/greg
mkdir /tmp/kim
mkdir /tmp/greg
# Start with a cloned repository, as before.
cd /tmp/greg
git clone file:///tmp/migration/blessed/proprietary
# That created a proprietary/ subdirectory. Add a sub-subdirectory
# there for Kim's bundles...
cd proprietary
mkdir kim
# ...and, the first time only, create a dummy bundle there, replacing
# the 'origin' repository with that bundle:
git bundle create kim/kim.bundle HEAD --branches
git remote rename origin kim
git remote set-url kim kim/kim.bundle
# That initial bundle happens to contain the whole repository. But we'll
# overwrite it with each incremental bundle we receive.
# Set up Kim's simulated machine the same way:
cd /tmp/kim
git clone file:///tmp/migration/blessed/proprietary
cd proprietary
mkdir greg
git bundle create greg/greg.bundle HEAD --branches
git remote rename origin greg
git remote set-url greg greg/greg.bundle
# Now make a change (here, the first of the two patches recently posted
# on the mailing list), and create a bundle to email to Greg:
patch --strip=1 </tmp/first.patch
git commit --all -m"Remove RCS Id from ChangeLog"
git bundle create kim.bundle ^greg/master --branches
git rev-parse HEAD
# On Greg's machine, save the bundle from the email Kim just sent,
# overwriting the existing bundle; verify it; then pull from it, to
# synchronize with the repository on Kim's machine.
cd /tmp/greg/proprietary
cp -a /tmp/kim/proprietary/kim.bundle kim/
git ls-remote kim
git bundle verify kim/kim.bundle
git pull kim
git rev-parse HEAD
# Greg makes a change (the second patch recently posted), bundles it,
# and emails it to Kim.
patch --strip=1 </tmp/0002-Replace-svn-with-git.patch
git commit --all -m"Replace 'svn' with 'git'"
git bundle create greg.bundle ^kim/master HEAD --branches
git rev-parse HEAD
# As before, Kim saves Greg's bundle and pulls from it, and their HEAD
# sha1sums once again match:
cd /tmp/kim/proprietary
cp -a /tmp/greg/proprietary/greg.bundle greg/
git ls-remote greg
git bundle verify greg/greg.bundle
git pull greg
git rev-parse HEAD
# Kim makes and shares another change...
sed -i src/ChangeLog -e 's/MAINTENANCE/ MAINTENANCE/'
git commit --all -m"Add a space"
git bundle create kim.bundle ^greg/master --branches
git rev-parse HEAD
# ...and Greg pulls from it as before.
cd /tmp/greg/proprietary
cp -a /tmp/kim/proprietary/kim.bundle kim/
git ls-remote kim
git bundle verify kim/kim.bundle
git pull kim
git rev-parse HEAD
# Greg makes another change; Kim pulls it.
sed -i src/ChangeLog -e 's/MAINTENANCE/ MAINTENANCE/'
git commit --all -m"Add another space"
git bundle create greg.bundle ^kim/master --branches
git rev-parse HEAD
cd /tmp/kim/proprietary
cp -a /tmp/greg/proprietary/greg.bundle greg/
git ls-remote greg
git bundle verify greg/greg.bundle
git pull greg
git rev-parse HEAD
# Now Kim makes several changes, breaking them into two commits:
sed -i src/ChangeLog -e 's/MAINTENANCE/ MAINTENANCE/'
git commit --all -m"Add yet another space"
sed -i src/ChangeLog -e 's/MAINTENANCE/ MAINTENANCE/'
sed -i src/ChangeLog -e 's/MAINTENANCE/ MAINTENANCE/'
git commit --all -m"Add two more spaces"
git bundle create kim.bundle ^greg/master --branches
# Greg pulls that change and displays the log, which shows all six
# commits above:
cd /tmp/greg/proprietary
cp -a /tmp/kim/proprietary/kim.bundle kim/
git ls-remote kim
git bundle verify kim/kim.bundle
git pull kim
git rev-parse HEAD
git log --pretty=oneline -6