lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Proposed workflow for proprietary repository


From: Murphy, Kimberly
Subject: Re: [lmi] Proposed workflow for proprietary repository
Date: Thu, 10 Mar 2016 13:39:39 +0000

Greg Chicares wrote:

> * Preliminary git configuration
> > [...]
> * Create patch directories
> [...]
> * Setting up a working copy
> [...]
> Compare the sha1sums, which should certainly be identical:
> 
>   cd /opt/lmi/blessed/proprietary; git rev-parse HEAD
> b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
>   cd /opt/lmi/proprietary; git rev-parse HEAD
> b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc

So far so good:

/opt/lmi[0]$cd /opt/lmi/blessed/proprietary; git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
/opt/lmi/blessed/proprietary[0]$cd /opt/lmi/proprietary; git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
 
> * Applying an email patch
> 
> Suppose you receive two patches in email: one inline [0], and one as an
> attachment. 
> 
> Copy the inline patch between the "8<" scissors lines to the clipboard
> in whatever way your email program does that. Then paste it into a file:
> 
>   cat >/opt/lmi/proprietary-patches/in/first.patch
>   [paste from clipboard]
>   [press Ctrl-D]
> [...]
> Save the attachment
>   /opt/lmi/proprietary-patches/in/0002-Replace-svn-with-git.patch
> . (That process seems easier, but let's test it to
> make sure it's at least as robust.) Now apply the patches:
>
>   cd /opt/lmi/proprietary
>   git rev-parse HEAD
> b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
>   git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/first.patch
>   git rev-parse HEAD
> 5f876b0a61554fe59979ad7620ab61cc7dc0dd27
>   git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/0002-Replace-svn-with-git.patch
>   git rev-parse HEAD
> 5e4e7fd8ab35a196cd1f5cc3c5b981c960664226

Creating the first patched initially tripped me up; it failed:

/usr/bin[0]$cd /opt/lmi/proprietary
/opt/lmi/proprietary[0]$git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/first.patch
Patch format detection failed.
/opt/lmi/proprietary[128]$git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/0002-Replace-svn-with-git.patch
Applying: Replace 'svn' with 'git'
/opt/lmi/proprietary[0]$git rev-parse HEAD
2f21e6bab9880387660333be301c9bfdccb23b79

No issues on later tries, only different sha1sums:

/opt/lmi/proprietary[0]$cd /opt/lmi/proprietary
/opt/lmi/proprietary[0]$git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/first.patch
Applying: Remove $Id$ from change log
/opt/lmi/proprietary[0]$git rev-parse HEAD
13bc94ef1a0133ca83522679aba8d34bf9d80a3d
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/0002-Replace-svn-with-git.patch
Applying: Replace 'svn' with 'git'
/opt/lmi/proprietary[0]$git rev-parse HEAD
8237ff298439ba54d18e5bd5e4c49bcbbf58b350 

Even with both patches:
 http://lists.nongnu.org/archive/html/lmi/2016-03/msg00011.html 
 http://lists.nongnu.org/archive/html/lmi/2016-03/msg00013.html

similar results are observed:

/opt/lmi/proprietary[0]$cd /opt/lmi/proprietary
/opt/lmi/proprietary[0]$git rev-parse HEAD
b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/first.patch
Applying: Remove $Id$ from change log
/opt/lmi/proprietary[0]$git rev-parse HEAD
13bc94ef1a0133ca83522679aba8d34bf9d80a3d
/opt/lmi/proprietary[0]$git am --committer-date-is-author-date \
>     /opt/lmi/proprietary-patches/in/0002-Replace-svn-with-git.patch
Applying: Replace 'svn' with 'git'
/opt/lmi/proprietary[0]$git rev-parse HEAD
8237ff298439ba54d18e5bd5e4c49bcbbf58b350

For confirmation, here are the md5sums for the two files:

/opt/lmi/proprietary-patches/in[0]$md5sum *
08b126da53041705da07055894f39435 *0002-Replace-svn-with-git.patch
282eda2fc967af5ee5907445f5993129 *first.patch

> Our goal is to maintain synchronized but separate repositories, with no
> central server. To make sure we're synchronized, we'll compare sha1sums.
> To make the sha1sums match, we need '--committer-date-is-author-date';
> [...]
> The sha1sums given by the 'git rev-parse HEAD' commands above match
> those on the first line of each patch. Along with the starting sha1sum
> of the migrated svn repository, they match git's log, too:
> 
>   git log -3 | grep '^commit'
> commit 5e4e7fd8ab35a196cd1f5cc3c5b981c960664226
> commit 5f876b0a61554fe59979ad7620ab61cc7dc0dd27
> commit b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc

No match here:

/opt/lmi/proprietary[0]$git log -3 | grep '^commit'
commit 8237ff298439ba54d18e5bd5e4c49bcbbf58b350
commit 13bc94ef1a0133ca83522679aba8d34bf9d80a3d
commit b5f2b3d4cfd179bbe4ac433d5bbe86d922bec2dc

I'm confused as to why the difference from what's expected. Did I 
miss a step or configuration?  
 
> * Pushing from working copy to blessed bare repository
> 
> [Motivation: if two people's sha1sums diverge for any reason, and each
> has maintained a local blessed repository with all the shared changes,
> then a working copy can easily be regenerated by 'git clone'.]
> 
> After applying a set of patches that you sent or received in email,
> push it to your blessed repository. For example, after applying the
> two patches above, the status should look like this:
> 
>   git rev-parse HEAD
> 5e4e7fd8ab35a196cd1f5cc3c5b981c960664226
>   git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 2 commits.
> #
> nothing to commit (working directory clean)
> 
> Now push the patches:
> 
>   git push
> ...
> To file:///opt/lmi/blessed/proprietary
>    b5f2b3d..5e4e7fd  master -> master
> 
> As expected, b5f2b3d... has advanced to 5e4e7fd... .

/opt/lmi/proprietary[0]$git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
/opt/lmi/proprietary[0]$git push
Counting objects: 8, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 911 bytes | 0 bytes/s, done.
Total 8 (delta 4), reused 0 (delta 0)
To file:///opt/lmi/blessed/proprietary
   b5f2b3d..8237ff2  master -> master



This e-mail transmission may contain information that is proprietary, 
privileged and/or confidential and is intended exclusively for the person(s) to 
whom it is addressed. Any use, copying, retention or disclosure by any person 
other than the intended recipient or the intended recipient's designees is 
strictly prohibited. If you are not the intended recipient or their designee, 
please notify the sender immediately by return e-mail and delete all copies.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]