proj/gagit:main commit in: /

Michał Górny <[email protected]> Wed, 05 Aug 2026 11:00:44 +0000 (UTC)
Newsgroups gmane.linux.gentoo.cvs
Message-ID <1785927632.b2edcd033f3abdaca16c1a3fd369f8ea941cf7d7.mgorny@gentoo>
commit:     b2edcd033f3abdaca16c1a3fd369f8ea941cf7d7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 11:00:17 2026 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 11:00:32 2026 +0000
URL:        https://gitweb.gentoo.org/proj/gagit.git/commit/?id=b2edcd03

Actually, default it with >1 commits too, adding "and more"

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 gagit | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/gagit b/gagit
index 2c690c6..e63924b 100755
--- a/gagit
+++ b/gagit
@@ -231,17 +231,11 @@ main() {
 
 	local commits=()
 	mapfile commits < <(git log --format='# %h %s' "${target}..${branch}")
-	case ${#commits[@]} in
-		0)
-			die "No changes found in ${target}..${branch} range"
-			;;
-		1)
-			: "${title:=$(git log --format='WIP: %s' -1)}"
-			: "${description:=$(git log --format='%b' -1)}"
-			;;
-	esac
+	[[ ${#commits[@]} -eq 0 ]] &&
+		die "No changes found in ${target}..${branch} range"
 
-	: "${title:=WIP: ${topic}}"
+	: "${title:=$(git log --format="WIP: %s${commits[1]+ (and more)}" -1)}"
+	: "${description:=$(git log --format='%b' -1)}"
 
 	tempdir=$(mktemp -d) || die "Unable to create a temporary directory"
 	trap 'rm -r -f "${tempdir}"' EXIT