public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gdb] gdb-17.2-rebase-f44: update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir
Date: Sun, 28 Jun 2026 00:00:39 GMT	[thread overview]
Message-ID: <178260483919.1.4138562478832738322.rpms-gdb-b3cbe4b669cd@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : b3cbe4b669cd1ed23884d9cc9c3da9fd08d314ca
Author : Bruno Larsen <blarsen@redhat.com>
Date   : 2022-06-06T16:28:12-03:00
Stats  : +7/-6 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/b3cbe4b669cd1ed23884d9cc9c3da9fd08d314ca?branch=gdb-17.2-rebase-f44

Log:
update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir

---
diff --git a/generate-git-repo-from-patches.sh b/generate-git-repo-from-patches.sh
index 8477e30..8646c4e 100755
--- a/generate-git-repo-from-patches.sh
+++ b/generate-git-repo-from-patches.sh
@@ -51,12 +51,12 @@ test -f _patch_order || die "Cannot find _patch_order file."
 
 last_ancestor_commit=`cat _git_upstream_commit`
 
+f=`pwd`
 cd $1
 
 git name-rev $last_ancestor_commit
 test $? -eq 0 || die "Could not find $last_ancestor_commit in the repository $1.  Did you run 'git fetch'?"
 
-f=`cd .. && pwd`
 
 # Create a branch for the checkout if using stgit; use the distro name in
 # the name of this branch.
@@ -69,8 +69,8 @@ fi
 git checkout $branch $last_ancestor_commit
 
 echo "Applying patches..."
-for p in `cat ../_patch_order` ; do
-    git am ../$p
+for p in `cat $f/_patch_order` ; do
+    git am $f/$p
     test $? -eq 0 || die "Could not apply patch '$p'."
 done
 

diff --git a/generate-patches-from-git-repo.sh b/generate-patches-from-git-repo.sh
index c9bc3a9..7947c8a 100755
--- a/generate-patches-from-git-repo.sh
+++ b/generate-patches-from-git-repo.sh
@@ -50,6 +50,7 @@ for f in `cat _patch_order` ; do
     git rm -f $f
 done
 
+orig_dir=`pwd`
 cd $1
 
 # If patches were uncommitted when the patches were applied,
@@ -82,8 +83,8 @@ for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do
     # before, even if nothing has changed.  This is bad, so we replace
     # the commit hash by something constant (the string
     # "FEDORA_PATCHES").
-    git format-patch --no-signature --no-stat --keep-subject -1 --stdout $c | sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' -e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' > ../$fname
-    (cd .. && git add $fname)
+    git format-patch --no-signature --no-stat --keep-subject -1 --stdout $c | sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' -e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' > $orig_dir/$fname
+    (cd $orig_dir && git add $fname)
 
     cat >> $temp_PATCH_file <<EOF
 `git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
@@ -94,7 +95,7 @@ EOF
     idx=`expr $idx + 1`
 done
 
-cd ..
+cd $orig_dir
 mv $temp_PATCH_file _gdb.spec.Patch.include
 mv $temp_patch_file _gdb.spec.patch.include
 mv $temp_patch_order_file _patch_order

                 reply	other threads:[~2026-06-28  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178260483919.1.4138562478832738322.rpms-gdb-b3cbe4b669cd@fedoraproject.org \
    --to=blarsen@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox