[PATCH/foreman 1/1] fixes #1364 - mail_patches in 0.4-stable branch referes to develop

this patch introduce the foreman_patch_branch environment variable
the default branch for git format-patch is origin/develop,
this can be problematic in case of a multible branch ecosystem
(generates more patches as needed).

the foreman_patch_branch variable overwrite the default branch.

e.g on linux:

% export foreman_patch_branch='origin/0.4-stable'

Signed-off-by: Florian Koch <florian.koch1981@googlemail.com>

··· --- lib/tasks/patches.rake | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lib/tasks/patches.rake b/lib/tasks/patches.rake
index 3fd622b…b2218a0 100644
— a/lib/tasks/patches.rake
+++ b/lib/tasks/patches.rake
@@ -3,9 +3,11 @@ task :mail_patches do
if Dir.glob(“00*.patch”).length > 0
raise "Patches already exist matching ‘00*.patch’; clean up first"
end
+

  • patch_branch = ENV[‘foreman_patch_branch’] || ‘origin/develop’

    Create all of the patches

  • sh “git format-patch -C -M -s -n --subject-prefix=‘PATCH/foreman’ origin/develop”
  • sh “git format-patch -C -M -s -n --subject-prefix=‘PATCH/foreman’ #{patch_branch}”

    If we’ve got more than one patch, add --compose

    compose = Dir.glob(“00*.patch”).length > 1 ? “–compose” : “”

    1.7.6.4

I was giving this a second thought, and maybe a much simple fix for
our current issue is to change the branch name in the 0.4.x branch,
and leave it as it is in the develop branch?

Ohad

··· On Thu, Dec 1, 2011 at 10:47 PM, Florian Koch wrote: > this patch introduce the foreman_patch_branch environment variable > the default branch for git format-patch is origin/develop, > this can be problematic in case of a multible branch ecosystem > (generates more patches as needed). > > the foreman_patch_branch variable overwrite the default branch. > > e.g on linux: > > % export foreman_patch_branch='origin/0.4-stable' > > Signed-off-by: Florian Koch > --- > lib/tasks/patches.rake | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/lib/tasks/patches.rake b/lib/tasks/patches.rake > index 3fd622b..b2218a0 100644 > --- a/lib/tasks/patches.rake > +++ b/lib/tasks/patches.rake > @@ -3,9 +3,11 @@ task :mail_patches do > if Dir.glob("00*.patch").length > 0 > raise "Patches already exist matching '00*.patch'; clean up first" > end > + > + patch_branch = ENV['foreman_patch_branch'] || 'origin/develop' > > # Create all of the patches > - sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' origin/develop" > + sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' #{patch_branch}" > > # If we've got more than one patch, add --compose > compose = Dir.glob("00*.patch").length > 1 ? "--compose" : "" > -- > 1.7.6.4 >

hm , yes this would fix it, with the patch we are flexible.

··· On Dec 2, 7:31 am, Ohad Levy wrote: > On Thu, Dec 1, 2011 at 10:47 PM, Florian Koch > > > > > > > > > > wrote: > > this patch introduce the foreman_patch_branch environment variable > > the default branch for git format-patch is origin/develop, > > this can be problematic in case of a multible branch ecosystem > > (generates more patches as needed). > > > the foreman_patch_branch variable overwrite the default branch. > > > e.g on linux: > > > % export foreman_patch_branch='origin/0.4-stable' > > > Signed-off-by: Florian Koch > > --- > > lib/tasks/patches.rake | 4 +++- > > 1 files changed, 3 insertions(+), 1 deletions(-) > > > diff --git a/lib/tasks/patches.rake b/lib/tasks/patches.rake > > index 3fd622b..b2218a0 100644 > > --- a/lib/tasks/patches.rake > > +++ b/lib/tasks/patches.rake > > @@ -3,9 +3,11 @@ task :mail_patches do > > if Dir.glob("00*.patch").length > 0 > > raise "Patches already exist matching '00*.patch'; clean up first" > > end > > + > > + patch_branch = ENV['foreman_patch_branch'] || 'origin/develop' > > > # Create all of the patches > > - sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' origin/develop" > > + sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' #{patch_branch}" > > > # If we've got more than one patch, add --compose > > compose = Dir.glob("00*.patch").length > 1 ? "--compose" : "" > > -- > > 1.7.6.4 > > I was giving this a second thought, and maybe a much simple fix for > our current issue is to change the branch name in the 0.4.x branch, > and leave it as it is in the develop branch? > > Ohad

> hm , yes this would fix it, with the patch we are flexible.

So does that mean I should only commit it to the stable branch? or
another commit?

Thanks,
Ohad

··· On Fri, Dec 2, 2011 at 11:53 AM, f0 wrote: > > > On Dec 2, 7:31 am, Ohad Levy wrote: >> On Thu, Dec 1, 2011 at 10:47 PM, Florian Koch >> >> >> >> >> >> >> >> >> >> wrote: >> > this patch introduce the foreman_patch_branch environment variable >> > the default branch for git format-patch is origin/develop, >> > this can be problematic in case of a multible branch ecosystem >> > (generates more patches as needed). >> >> > the foreman_patch_branch variable overwrite the default branch. >> >> > e.g on linux: >> >> > % export foreman_patch_branch='origin/0.4-stable' >> >> > Signed-off-by: Florian Koch >> > --- >> > lib/tasks/patches.rake | 4 +++- >> > 1 files changed, 3 insertions(+), 1 deletions(-) >> >> > diff --git a/lib/tasks/patches.rake b/lib/tasks/patches.rake >> > index 3fd622b..b2218a0 100644 >> > --- a/lib/tasks/patches.rake >> > +++ b/lib/tasks/patches.rake >> > @@ -3,9 +3,11 @@ task :mail_patches do >> > if Dir.glob("00*.patch").length > 0 >> > raise "Patches already exist matching '00*.patch'; clean up first" >> > end >> > + >> > + patch_branch = ENV['foreman_patch_branch'] || 'origin/develop' >> >> > # Create all of the patches >> > - sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' origin/develop" >> > + sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' #{patch_branch}" >> >> > # If we've got more than one patch, add --compose >> > compose = Dir.glob("00*.patch").length > 1 ? "--compose" : "" >> > -- >> > 1.7.6.4 >> >> I was giving this a second thought, and maybe a much simple fix for >> our current issue is to change the branch name in the 0.4.x branch, >> and leave it as it is in the develop branch? >> >> Ohad

commit to stable branch

··· On Dec 13, 1:48 pm, Ohad Levy wrote: > On Fri, Dec 2, 2011 at 11:53 AM, f0 wrote: > > hm , yes this would fix it, with the patch we are flexible. > > So does that mean I should only commit it to the stable branch? or > another commit? > > Thanks, > Ohad > > > > > > > > > > > On Dec 2, 7:31 am, Ohad Levy wrote: > >> On Thu, Dec 1, 2011 at 10:47 PM, Florian Koch > > >> wrote: > >> > this patch introduce the foreman_patch_branch environment variable > >> > the default branch for git format-patch is origin/develop, > >> > this can be problematic in case of a multible branch ecosystem > >> > (generates more patches as needed). > > >> > the foreman_patch_branch variable overwrite the default branch. > > >> > e.g on linux: > > >> > % export foreman_patch_branch='origin/0.4-stable' > > >> > Signed-off-by: Florian Koch > >> > --- > >> > lib/tasks/patches.rake | 4 +++- > >> > 1 files changed, 3 insertions(+), 1 deletions(-) > > >> > diff --git a/lib/tasks/patches.rake b/lib/tasks/patches.rake > >> > index 3fd622b..b2218a0 100644 > >> > --- a/lib/tasks/patches.rake > >> > +++ b/lib/tasks/patches.rake > >> > @@ -3,9 +3,11 @@ task :mail_patches do > >> > if Dir.glob("00*.patch").length > 0 > >> > raise "Patches already exist matching '00*.patch'; clean up first" > >> > end > >> > + > >> > + patch_branch = ENV['foreman_patch_branch'] || 'origin/develop' > > >> > # Create all of the patches > >> > - sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' origin/develop" > >> > + sh "git format-patch -C -M -s -n --subject-prefix='PATCH/foreman' #{patch_branch}" > > >> > # If we've got more than one patch, add --compose > >> > compose = Dir.glob("00*.patch").length > 1 ? "--compose" : "" > >> > -- > >> > 1.7.6.4 > > >> I was giving this a second thought, and maybe a much simple fix for > >> our current issue is to change the branch name in the 0.4.x branch, > >> and leave it as it is in the develop branch? > > >> Ohad