public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tool: simplify a git command in PERF-VERSION-GEN
@ 2013-10-02  8:28 Ramkumar Ramachandra
  2013-10-02  9:42 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Ramkumar Ramachandra @ 2013-10-02  8:28 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Namhyung Kim, Arnaldo Carvalho de Melo

Replace a complex git log invocation with a simpler git rev-parse
invocation.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 tools/perf/util/PERF-VERSION-GEN | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 15a77b7..b23d11b 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -18,7 +18,7 @@ TAG=
 if test -d ../../.git -o -f ../../.git
 then
 	TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
-	CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
+	CID=$(git rev-parse --short HEAD 2>/dev/null) && CID="-g$CID"
 fi
 if test -z "$TAG"
 then
-- 
1.8.4.477.g5d89aa9


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

* Re: [PATCH] perf tool: simplify a git command in PERF-VERSION-GEN
  2013-10-02  8:28 [PATCH] perf tool: simplify a git command in PERF-VERSION-GEN Ramkumar Ramachandra
@ 2013-10-02  9:42 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2013-10-02  9:42 UTC (permalink / raw)
  To: Ramkumar Ramachandra; +Cc: LKML, Namhyung Kim, Arnaldo Carvalho de Melo


* Ramkumar Ramachandra <artagnon@gmail.com> wrote:

> Replace a complex git log invocation with a simpler git rev-parse
> invocation.
> 
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Namhyung Kim <namhyung@gmail.com>
> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
>  tools/perf/util/PERF-VERSION-GEN | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
> index 15a77b7..b23d11b 100755
> --- a/tools/perf/util/PERF-VERSION-GEN
> +++ b/tools/perf/util/PERF-VERSION-GEN
> @@ -18,7 +18,7 @@ TAG=
>  if test -d ../../.git -o -f ../../.git
>  then
>  	TAG=$(git describe --abbrev=0 --match "v[0-9].[0-9]*" 2>/dev/null )
> -	CID=$(git log -1 --abbrev=4 --pretty=format:"%h" 2>/dev/null) && CID="-g$CID"
> +	CID=$(git rev-parse --short HEAD 2>/dev/null) && CID="-g$CID"

This shaves 4 milliseconds off the build time as well.

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

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

end of thread, other threads:[~2013-10-02  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02  8:28 [PATCH] perf tool: simplify a git command in PERF-VERSION-GEN Ramkumar Ramachandra
2013-10-02  9:42 ` Ingo Molnar

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