mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format
@ 2007-11-03  1:52 Theodore Ts'o
  2007-11-03  1:53 ` [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag Theodore Ts'o
  2008-01-03 19:55 ` [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Sam Ravnborg
  0 siblings, 2 replies; 4+ messages in thread
From: Theodore Ts'o @ 2007-11-03  1:52 UTC (permalink / raw)
  To: linux-kernel; +Cc: Theodore Ts'o

Change the automatic local version to have the form -nnnnn-gSHA1SUMID,
where 'nnnnn' is the number of commits since the last tag (i.e.,
2.6.21-rc7).  This makes it much more likely that the package names created
for the kernel will look "newer" to a package manager.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 scripts/setlocalversion |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 82e4993..20711f5 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -12,7 +12,7 @@ cd "${1:-.}" || usage
 if head=`git rev-parse --verify 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
-		printf '%s%s' -g `echo "$head" | cut -c1-8`
+	        git-describe | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
 	fi
 
 	# Are there uncommitted changes?
-- 
1.5.3.4.499.g1104e-dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag
  2007-11-03  1:52 [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Theodore Ts'o
@ 2007-11-03  1:53 ` Theodore Ts'o
  2007-11-03  1:53   ` [PATCH,RFC 3/3] scripts/setlocalversion: Fix false positive -dirty tag caused by make-kpkg Theodore Ts'o
  2008-01-03 19:55 ` [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Sam Ravnborg
  1 sibling, 1 reply; 4+ messages in thread
From: Theodore Ts'o @ 2007-11-03  1:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Theodore Ts'o

If git's index file is out of date, and some files have been touched
such that their timestamp doesn't what is in the index, "git
diff-index HEAD" may show that a particular file is dirty, when in
fact it really isn't.  Running "git status" will update the index to
avoid these false positives.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 scripts/setlocalversion |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 20711f5..bfc8c8c 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -16,6 +16,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 	fi
 
 	# Are there uncommitted changes?
+	git status >& /dev/null
 	if git diff-index HEAD | read dummy; then
 		printf '%s' -dirty
 	fi
-- 
1.5.3.4.499.g1104e-dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH,RFC 3/3] scripts/setlocalversion: Fix false positive -dirty tag caused by make-kpkg
  2007-11-03  1:53 ` [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag Theodore Ts'o
@ 2007-11-03  1:53   ` Theodore Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2007-11-03  1:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Theodore Ts'o

make-kpkg modifies scripts/package/Makefile and deletes
scripts/package/builddeb as part of its build process.  Ignore these
changes so the tree isn't marked as -dirty, when it is just an
artifact of make-kpkg.  (make-kpkg clean restores the files to their
original state, and these helper scripts won't affect the final
compiled kernel in any way.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 scripts/setlocalversion |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index bfc8c8c..ad56a06 100644
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -17,7 +17,8 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 
 	# Are there uncommitted changes?
 	git status >& /dev/null
-	if git diff-index HEAD | read dummy; then
+	if git diff-index --name-only HEAD | grep -v "^scripts/package" \
+	    | read dummy; then
 		printf '%s' -dirty
 	fi
 fi
-- 
1.5.3.4.499.g1104e-dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format
  2007-11-03  1:52 [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Theodore Ts'o
  2007-11-03  1:53 ` [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag Theodore Ts'o
@ 2008-01-03 19:55 ` Sam Ravnborg
  1 sibling, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2008-01-03 19:55 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-kernel

On Fri, Nov 02, 2007 at 09:52:59PM -0400, Theodore Ts'o wrote:
> Change the automatic local version to have the form -nnnnn-gSHA1SUMID,
> where 'nnnnn' is the number of commits since the last tag (i.e.,
> 2.6.21-rc7).  This makes it much more likely that the package names created
> for the kernel will look "newer" to a package manager.

Applied all three. Removed the dash in git describe to make in conformant
to versions of git without it.

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-03 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-03  1:52 [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Theodore Ts'o
2007-11-03  1:53 ` [PATCH,RFC 2/3] Fix scripts/setlocalversion to avoid erroneous -dirty tag Theodore Ts'o
2007-11-03  1:53   ` [PATCH,RFC 3/3] scripts/setlocalversion: Fix false positive -dirty tag caused by make-kpkg Theodore Ts'o
2008-01-03 19:55 ` [PATCH,RFC 1/3] Change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format Sam Ravnborg

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

all inboxes | Powered by JetHome®