Stefan Tauner has uploaded this change for review. ( https://review.coreboot.org/21829
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Rename getrevision's local_revision function to just revision.
All revisions are local in git and we certainly wont go back to
a non-distributed VCS :)
Change-Id: I6689ac24077b3981b471ed69de7cc3ef79d435b1
---
M Makefile
M util/getrevision.sh
2 files changed, 8 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/29/21829/1
diff --git a/Makefile b/Makefile
index fd1fc3b..b2db918 100644
--- a/Makefile
+++ b/Makefile
@@ -530,7 +530,7 @@
# export rule. If Makefile.VCS is not found, version info will be obtained
# using util/getrevision.sh.
ifeq ($(wildcard Makefile.VCS),)
-VERSION ?= $(shell ./util/getrevision.sh --local)
+VERSION ?= $(shell ./util/getrevision.sh --revision)
MAN_DATE ?= $(shell ./util/getrevision.sh --date $(PROGRAM).8.tmpl 2>/dev/null)
else
include Makefile.VCS
diff --git a/util/getrevision.sh b/util/getrevision.sh
index b332d04..cdd9b73 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -130,8 +130,7 @@
echo "${t}"
}
-# Retrieve local revision info.
-local_revision() {
+revision() {
local r
if git_is_file_tracked "$1" ; then
r=$(git describe $(git_last_commit "$1"))
@@ -158,8 +157,8 @@
this message
-c or --check
test if path is under version control at all
- -l or --local
- local revision information including an indicator for uncommitted changes
+ -r or --revision
+ return unique revision information
-U or --url
URL associated with the latest commit
-d or --date
@@ -188,10 +187,6 @@
-h|--help)
action=show_help;
shift;;
- -l|--local)
- check_action $1
- action=local_revision
- shift;;
-U|--url)
check_action $1
action=scm_url
@@ -200,6 +195,10 @@
check_action $1
action="timestamp +%Y-%m-%d" # refrain from suffixing 'Z' to indicate it's UTC
shift;;
+ -r|--revision)
+ check_action $1
+ action=revision
+ shift;;
-t|--timestamp)
check_action $1
action="timestamp +%Y-%m-%dT%H:%M:%SZ" # There is only one valid time format! ISO 8601
--
To view, visit https://review.coreboot.org/21829
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6689ac24077b3981b471ed69de7cc3ef79d435b1
Gerrit-Change-Number: 21829
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Stefan Tauner has uploaded this change for review. ( https://review.coreboot.org/21828
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Note the non-strict POSIX compatibility in getrevision.sh and a a missing full stop
Change-Id: Ia60186f783067ba084439a8ef701dc8f4c0072f0
---
M util/getrevision.sh
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/28/21828/1
diff --git a/util/getrevision.sh b/util/getrevision.sh
index 0f97546..b332d04 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# NB: POSIX-compatible apart from the usage of 'local' to define variables within the scope of functions.
#
# This file is part of the flashrom project.
#
@@ -78,7 +79,7 @@
echo "$(git ls-remote --exit-code --get-url ${target%/*}) ${target#*/}"
}
-# Returns a string indicating where others can get the current source code (excluding uncommitted changes)
+# Returns a string indicating where others can get the current source code (excluding uncommitted changes).
# Takes one optional argument: the path to inspect
scm_url() {
local url=
--
To view, visit https://review.coreboot.org/21828
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia60186f783067ba084439a8ef701dc8f4c0072f0
Gerrit-Change-Number: 21828
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Stefan Tauner has uploaded this change for review. ( https://review.coreboot.org/21827
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
- make version string generation independent of the actual VCS
used by not generating "unknown" in the makefile but letting
getrevision do that
- make hook installation independent of version string generation
since they have nothing to do ith each other and there are no
synergies anymore
Change-Id: Iedc9df4c033a70447b8b1b65c83764c769b02c3f
---
M Makefile
M util/getrevision.sh
2 files changed, 8 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/27/21827/1
diff --git a/Makefile b/Makefile
index 62a3869..fd1fc3b 100644
--- a/Makefile
+++ b/Makefile
@@ -528,17 +528,10 @@
# Makefile.VCS is used when packaging flashrom and is generated by the
# export rule. If Makefile.VCS is not found, version info will be obtained
-# using util/getrevision.sh or "unknown" if SCM metadata directory isn't found.
+# using util/getrevision.sh.
ifeq ($(wildcard Makefile.VCS),)
-ifeq ($(wildcard .git),)
-VERSION ?= unknown
-MAN_DATE ?= unknown
-else
VERSION ?= $(shell ./util/getrevision.sh --local)
-MAN_DATE ?= $(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl 2>/dev/null)
-# This is also a convenient time to install hooks.
-$(shell ./util/git-hooks/install.sh)
-endif
+MAN_DATE ?= $(shell ./util/getrevision.sh --date $(PROGRAM).8.tmpl 2>/dev/null)
else
include Makefile.VCS
endif
@@ -557,6 +550,9 @@
# Inform user of the version string
$(info Replacing all version templates with $(VERSION).)
+# If a VCS is found then try to install hooks.
+$(shell ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh)
+
###############################################################################
# Default settings of CONFIG_* variables.
diff --git a/util/getrevision.sh b/util/getrevision.sh
index e1580e5..0f97546 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -131,13 +131,14 @@
# Retrieve local revision info.
local_revision() {
+ local r
if git_is_file_tracked "$1" ; then
- local r=$(git describe $(git_last_commit "$1"))
+ r=$(git describe $(git_last_commit "$1"))
if git_has_local_changes "$1" ; then
r="$r-dirty"
fi
else
- return ${EXIT_FAILURE}
+ r="unknown"
fi
echo "${r}"
--
To view, visit https://review.coreboot.org/21827
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iedc9df4c033a70447b8b1b65c83764c769b02c3f
Gerrit-Change-Number: 21827
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Stefan Tauner has uploaded this change for review. ( https://review.coreboot.org/21826
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Use a more generic file name for the exported VCS data.
Currently we only export the flashrom version string and
makefile change date but even this later data is not a "version".
Change-Id: Ie57b20dc014ba44ded5783bdb432eb7d0e0e28ad
---
M Makefile
1 file changed, 7 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/26/21826/1
diff --git a/Makefile b/Makefile
index a649f38..62a3869 100644
--- a/Makefile
+++ b/Makefile
@@ -526,10 +526,10 @@
CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
-# Makefile.version is used when packaging flashrom and is generated by the
-# export rule. If Makefile.version is not found, version info will be obtained
+# Makefile.VCS is used when packaging flashrom and is generated by the
+# export rule. If Makefile.VCS is not found, version info will be obtained
# using util/getrevision.sh or "unknown" if SCM metadata directory isn't found.
-ifeq ($(wildcard Makefile.version),)
+ifeq ($(wildcard Makefile.VCS),)
ifeq ($(wildcard .git),)
VERSION ?= unknown
MAN_DATE ?= unknown
@@ -540,7 +540,7 @@
$(shell ./util/git-hooks/install.sh)
endif
else
-include Makefile.version
+include Makefile.VCS
endif
# VERSION equals "offline" if online access is required but the respective git
@@ -1402,10 +1402,9 @@
@rm -rf "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
@mkdir -p "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
@git archive HEAD | tar -x -C "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
-# Generate Makefile.version since SCM metadata won't be available in
-# exported sources.
- @echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
- @echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
+# Generate Makefile.VCS containing metadata that would not be available in exported sources otherwise.
+ @echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.VCS"
+ @echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.VCS"
# Restore modification date of all tracked files not marked 'export-ignore' in .gitattributes.
# sed is required to filter out file names having the attribute set.
# The sed program saves the file name in the hold buffer and then checks if the respective value is 'set'.
--
To view, visit https://review.coreboot.org/21826
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie57b20dc014ba44ded5783bdb432eb7d0e0e28ad
Gerrit-Change-Number: 21826
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Stefan Tauner has uploaded this change for review. ( https://review.coreboot.org/21825
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Fix broken/one-off loop to restore file dates.
Explain what the sed program actually does because it is non-trivial.
Change-Id: Iff4021be49a9fab208b619c555b9f9e81f671ab8
---
M Makefile
1 file changed, 6 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/25/21825/1
diff --git a/Makefile b/Makefile
index 9c3ed72..a649f38 100644
--- a/Makefile
+++ b/Makefile
@@ -1406,16 +1406,17 @@
# exported sources.
@echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
@echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
-# Restore modification date of all tracked files not marked
-# 'export-ignore' in .gitattributes. sed is required to filter out file
-# names having the attribute set.
+# Restore modification date of all tracked files not marked 'export-ignore' in .gitattributes.
+# sed is required to filter out file names having the attribute set.
+# The sed program saves the file name in the hold buffer and then checks if the respective value is 'set'.
+# If so it ignores the rest of the program, which otherwise restores the file name and prints it.
@git ls-tree -r -z -t --full-name --name-only HEAD | \
git check-attr -z --stdin export-ignore | \
- sed -zne 'x;n;n;/^set$$/{b};x;p' | \
+ sed -zne 'x;n;n;{/^set$$/b;};x;p;' | \
xargs -0 sh -c 'for f; do \
touch -d $$(git log --pretty=format:%cI -1 HEAD -- "$$f") \
"$(EXPORTDIR)/flashrom-$(RELEASENAME)/$$f"; \
- done'
+ done' dummy_arg0
export: _export
@echo "Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/"
--
To view, visit https://review.coreboot.org/21825
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff4021be49a9fab208b619c555b9f9e81f671ab8
Gerrit-Change-Number: 21825
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Nico Huber has posted comments on this change. ( https://review.coreboot.org/21776 )
Change subject: Convert flashrom to git
......................................................................
Patch Set 2:
And I still won't review it this way. Single commits with a focused
commit message are easy to review. But this... I refuse to search a
commit message diff for the explanation of the changes.
If you find somebody else to review it, fine, I'll draw back my -2.
--
To view, visit https://review.coreboot.org/21776
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: stable
Gerrit-MessageType: comment
Gerrit-Change-Id: I08a324ce1fd8afcc6f516ddfb6f09e05a67cdd17
Gerrit-Change-Number: 21776
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sun, 01 Oct 2017 08:45:58 +0000
Gerrit-HasComments: No
Nico Huber has posted comments on this change. ( https://review.coreboot.org/21776 )
Change subject: Convert flashrom to git
......................................................................
Patch Set 2: Code-Review-2
I do mind. It violates the topic. I don't want any functional changes,
that were not tested on staging for some time, this close to the
release.
--
To view, visit https://review.coreboot.org/21776
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: stable
Gerrit-MessageType: comment
Gerrit-Change-Id: I08a324ce1fd8afcc6f516ddfb6f09e05a67cdd17
Gerrit-Change-Number: 21776
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sun, 01 Oct 2017 08:41:28 +0000
Gerrit-HasComments: No
Stefan Tauner has posted comments on this change. ( https://review.coreboot.org/21776 )
Change subject: Convert flashrom to git
......................................................................
Patch Set 2:
I think you have missed some of the improvements of your own reviews in the rebase. This seemed to be a good opportunity to merge in my changes (without the version change) to make them reviewable - hope you don't mind the hijacking.
--
To view, visit https://review.coreboot.org/21776
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: stable
Gerrit-MessageType: comment
Gerrit-Change-Id: I08a324ce1fd8afcc6f516ddfb6f09e05a67cdd17
Gerrit-Change-Number: 21776
Gerrit-PatchSet: 2
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sun, 01 Oct 2017 00:45:43 +0000
Gerrit-HasComments: No