public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: Make generate-patches-from-git-repo.sh use "_git_upstream_commit" instead of "origin/master" for "git merge-base".
@ 2026-06-27 23:58 Sergio Durigan Junior
  0 siblings, 0 replies; only message in thread
From: Sergio Durigan Junior @ 2026-06-27 23:58 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : 82f299dd3bff6e7c8cb1bd679255bad0c54df56b
Author : Sergio Durigan Junior <sergiodj@sergiodj.net>
Date   : 2018-02-05T13:01:55-05:00
Stats  : +18/-6 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/82f299dd3bff6e7c8cb1bd679255bad0c54df56b?branch=gdb-17.2-rebase-f44

Log:
Make generate-patches-from-git-repo.sh use "_git_upstream_commit" instead of "origin/master" for "git merge-base".

---
diff --git a/README.local-patches b/README.local-patches
index c1c7ab3..ea7162a 100644
--- a/README.local-patches
+++ b/README.local-patches
@@ -94,3 +94,12 @@ control files.  These control files are:
   - _git_upstream_commit: This file contains the last upstream commit
     against which the patches were rebased.  It is used when importing
     the patches into the git repository.
+
+NOTE: If you did a rebase against a newer upstream version, you need
+to specify the commit/tag/branch against which you rebased:
+
+  $ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> <COMMIT_OR_TAG_OR_BRANCH>
+
+For example, if you rebased against "gdb-8.1-release":
+
+  $ sh generate-patches-from-git-repo.sh <REPOSITORY_DIR> gdb-8.1-release

diff --git a/generate-patches-from-git-repo.sh b/generate-patches-from-git-repo.sh
index ded0659..97e0408 100755
--- a/generate-patches-from-git-repo.sh
+++ b/generate-patches-from-git-repo.sh
@@ -14,14 +14,15 @@ usage ()
 $0 -- Generate .patch files for a RPM package from a git repository
 
 Usage:
-  $0 <REPOSITORY> [<COMMIT_OR_TAG>]
+  $0 <REPOSITORY> [<COMMIT_OR_TAG_OR_BRANCH>]
 
 <REPOSITORY> is the directory where the rebase was performed.
 
-<COMMIT_OR_TAG> is the commit or tag against which the rebase was
-performed.  It is optional, and if not provided "origin/master" will
-be used.  This script will then use 'git merge-base' to find the most
-recent common ancestor between HEAD and COMMIT_OR_TAG.
+<COMMIT_OR_TAG_OR_BRANCH> is the commit or tag or branch against which
+the rebase was performed.  It generally just needs to be provided if
+the file "_git_upstream_commit" doesn't exist, or if you are doing a
+rebase.  This script will then use 'git merge-base' to find the most
+recent common ancestor between HEAD and COMMIT_OR_TAG_OR_BRANCH.
 
 Options are:
 
@@ -35,11 +36,13 @@ test -f gdb.spec || die "This script needs to run from the same directory as gdb
 test -z $1 && die "You need to specify the repository."
 test "$1" = "-h" && usage
 
-commit_or_tag="origin/master"
+commit_or_tag="`cat _git_upstream_commit`"
 if test ! -z "$2" ; then
     commit_or_tag="$2"
 fi
 
+test -z $commit_or_tag && die "Because the '_git_upstream_commit' file doesn't exist, you need to specify a commit/tag/branch."
+
 test -d $1 || die "$1 is not a directory."
 
 # Remove all the current patches

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-27 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 23:58 [rpms/gdb] gdb-17.2-rebase-f44: Make generate-patches-from-git-repo.sh use "_git_upstream_commit" instead of "origin/master" for "git merge-base" Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox