lilypond-devel
[Top][All Lists]
Advanced

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

Re: what should patchy do for staging?


From: David Kastrup
Subject: Re: what should patchy do for staging?
Date: Wed, 09 Nov 2011 17:33:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Graham Percival <address@hidden> writes:

> On Wed, Nov 09, 2011 at 09:58:56AM +0100, David Kastrup wrote:
>> [Diversion: by the way, Phil and Graham?  I have come to the conclusion
>>   that it is better if Patchy does not attempt any rebases or merges on
>>   its own.  Can you change that accordingly?  It should quite simplify
>>   Patchy and make its behavior more predictable: it would just try to
>>   push its tested version of dev/staging to master, and if that fails,
>>   it fails.
>
> I am in the middle of reinstalling OSes, setting up development
> environments, and making the 2.15.17 release.  And I do not
> understand, nor do I *care* to understand, the difference between
> rebase and merge.
>
> Run this command:
>   git clone git://github.com/gperciva/lilypond-extra.git
>
> and then edit the
>   patches/compile_lilypond_test.py
>
> I think you are interested in the
>     def merge_staging(self):
> and
>     def merge_push(self)
> and maybe the
>     def staging()
>
> functions.  Send patch, or push directly to github if you have an
> account there.  I am totally not picking about patches to
> lilypond-extra at all.  No review (unless you want one), no
> countdown, no fuss.

Try the following, and please make it fail if any command returns a
non-zero exit status.  I don't know Python at all.

diff --git a/patches/compile_lilypond_test.py b/patches/compile_lilypond_test.py
index 5f66ac7..ecce6b3 100755
--- a/patches/compile_lilypond_test.py
+++ b/patches/compile_lilypond_test.py
@@ -177,26 +177,16 @@ class AutoCompile():
     def merge_staging(self):
         if os.path.exists(self.src_dir):
             shutil.rmtree(self.src_dir)
+        os.system("git --git-dir=%s/.git fetch" % self.git_repository_dir)
         os.makedirs(self.src_dir)
-        os.chdir(self.git_repository_dir)
-        # TODO: this destroys whatever is in git dir; avoid if possible
-        os.system("git fetch")
+        os.chdir(self.src_dir)
+        os.system("git clone --mirror -s %s .git" % self.git_repository_dir)
+        os.system("git --git-dir=.git config core.bare false")
         # WTF? it works without --preserve-merges, but with them,
         # it fails with: Invalid branchname: origin/dev/staging
         #os.system("git rebase --preserve-merges origin/master 
origin/dev/staging")
-        os.system("git rebase origin/master origin/dev/staging")
-        # copy stuff to the build src_dir
-        src_filenames = glob.glob(os.path.join(self.git_repository_dir, "*"))
-        src_filenames = filter(lambda x: "build" not in x, src_filenames)
-        for filename in src_filenames:
-            # WTF isn't this working?
-            #if os.path.isdir(filename):
-            #    shutil.copytree(filename, self.src_dir)
-            #else:
-            #    shutil.copy(filename, self.src_dir)
-            cmd = "cp -r %s %s" % (filename, self.src_dir)
-            #print cmd
-            os.system(cmd)
+        os.system("git checkout origin/master")
+        os.system("git merge --ff-only origin/dev/staging")
         os.makedirs(self.build_dir)
 
 

-- 
David Kastrup

reply via email to

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