Message ID | 20161101193354.8716-1-ricardo.martincoski@datacom.ind.br |
---|---|
State | Changes Requested |
Headers | show |
On 01-11-16 20:33, Ricardo Martincoski wrote: > In preparation to have automated tests for this script, display the > checked out sha1 in the build log. > > Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> > --- > Another solution would be to use an environment variable set by the test > to print that info, e.g. if [ "1" == "${GIT_DOWNLOAD_AUTOTEST}" ]; then > --- > support/download/git | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/support/download/git b/support/download/git > index 7921411..7c44c65 100755 > --- a/support/download/git > +++ b/support/download/git > @@ -85,6 +85,12 @@ if [ ${recurse} -eq 1 ]; then > _git submodule update --init --recursive > fi > > +# Log the sha1. It can be used for automated tests and debug. > +if [ -z ${verbose} ]; then It's quite weird to check that verbose is empty, but that's how the variable is defined... Perhaps s/verbose/quiet/ would be a good idea... Regards, Arnout > + sha1=$(_git rev-parse HEAD) > + printf "Checked out '%s'.\n" "${sha1}" > +fi > + > # We do not need the .git dir; we keep other .git files, in case they > # are the only files in their directory. > rm -rf .git >
Arnout, Thank you for reviewing this series. On Sat, Nov 05, 2016 at 07:50 PM, Arnout Vandecappelle wrote: [snip] >> +if [ -z ${verbose} ]; then > > It's quite weird to check that verbose is empty, but that's how the variable is > defined... Perhaps s/verbose/quiet/ would be a good idea... OK, makes sense. I can send a followup patch. Regards, Ricardo
diff --git a/support/download/git b/support/download/git index 7921411..7c44c65 100755 --- a/support/download/git +++ b/support/download/git @@ -85,6 +85,12 @@ if [ ${recurse} -eq 1 ]; then _git submodule update --init --recursive fi +# Log the sha1. It can be used for automated tests and debug. +if [ -z ${verbose} ]; then + sha1=$(_git rev-parse HEAD) + printf "Checked out '%s'.\n" "${sha1}" +fi + # We do not need the .git dir; we keep other .git files, in case they # are the only files in their directory. rm -rf .git
In preparation to have automated tests for this script, display the checked out sha1 in the build log. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@datacom.ind.br> --- Another solution would be to use an environment variable set by the test to print that info, e.g. if [ "1" == "${GIT_DOWNLOAD_AUTOTEST}" ]; then --- support/download/git | 6 ++++++ 1 file changed, 6 insertions(+)