From: Nico Schottelius <nico-linux-20090330@schottelius.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Nico Schottelius <nico-linux-20090330@schottelius.org>,
Jiri Kosina <jkosina@suse.cz>,
LKML <linux-kernel@vger.kernel.org>,
trivial@kernel.org
Subject: Re: [Resend] [PATCH] Fix scripts/setlocalversion with git
Date: Sat, 18 Apr 2009 11:16:53 +0200 [thread overview]
Message-ID: <20090418091653.GB16933@ikn.schottelius.org> (raw)
In-Reply-To: <20090417215802.GA16568@uranus.ravnborg.org>
[-- Attachment #1.1: Type: text/plain, Size: 501 bytes --]
Sam Ravnborg [Fri, Apr 17, 2009 at 11:58:02PM +0200]:
> I thought I already applied a similar fix.
> Care to resend.
- git: git://git.schottelius.org/foreign/linux-2.6 (URL changed!):
f43ba0be1204e7c26cc700a75bdb688a788fbf2fcommit
- Original patch attached (p1)
- Diff against your tree attached (p2)
Nico
--
Think about Free and Open Source Software (FOSS).
http://nico.schottelius.org/documentations/foss/the-term-foss/
PGP: BFE4 C736 ABE5 406F 8F42 F7CF B8BE F92A 9885 188C
[-- Attachment #1.2: p1 --]
[-- Type: text/plain, Size: 1451 bytes --]
commit f43ba0be1204e7c26cc700a75bdb688a788fbf2f
Author: Nico Schottelius <nico@ikn.schottelius.org>
Date: Tue Apr 7 17:27:18 2009 +0200
[PATCH] Fix scripts/setlocalversion with git
When using trees like wireless-testing, which have untagged tags,
scripts/setlocalversion does not display any git indication for
localversion.
This patch fixes it: If git is available, but no usable tag is found,
it uses -g${head}. It skips the detection of unanottated tags via
git name-rev.
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index f6946cf..296669a 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -10,13 +10,12 @@ cd "${1:-.}" || usage
# Check for git and a git repo.
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
- # Do we have an untagged version?
- if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
- if tag=`git describe 2>/dev/null`; then
- echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
- else
- printf '%s%s' -g $head
- fi
+ # Do we have an annotated tag?
+ if atag=`git describe 2>/dev/null`; then
+ echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ # add -g${head}, if there is no usable tag
+ else
+ printf '%s%s' -g $head
fi
# Is this git on svn?
[-- Attachment #1.3: p2 --]
[-- Type: text/plain, Size: 1042 bytes --]
--- kbuild-fixes/scripts/setlocalversion 2009-04-18 09:44:18.142135489 +0200
+++ linux-2.6/scripts/setlocalversion 2009-04-07 17:37:33.131483677 +0200
@@ -10,18 +10,17 @@
# Check for git and a git repo.
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
- # Do we have an untagged version?
- if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
- if tag=`git describe 2>/dev/null`; then
- echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
- else
- printf '%s%s' -g $head
- fi
+ # Do we have an annotated tag?
+ if atag=`git describe 2>/dev/null`; then
+ echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
+ # add -g${head}, if there is no usable tag
+ else
+ printf '%s%s' -g $head
fi
# Is this git on svn?
if git config --get svn-remote.svn.url >/dev/null; then
- printf -- '-svn%s' "`git svn find-rev $head`"
+ printf -- '-svn%s' "`git-svn find-rev $head`"
fi
# Are there uncommitted changes?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-04-18 9:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-30 12:21 [PATCH] Fix scripts/setlocalversion with git Nico Schottelius
2009-04-07 15:44 ` [Resend] " Nico Schottelius
2009-04-07 15:56 ` Jiri Kosina
2009-04-07 17:45 ` Sam Ravnborg
2009-04-17 21:34 ` Nico Schottelius
2009-04-17 21:58 ` Sam Ravnborg
2009-04-18 9:16 ` Nico Schottelius [this message]
2009-04-25 7:50 ` Sam Ravnborg
2009-04-25 12:24 ` Nico Schottelius
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=20090418091653.GB16933@ikn.schottelius.org \
--to=nico-linux-20090330@schottelius.org \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=trivial@kernel.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