[PATCH] Fix compilation error when git commit message has quotes (")

Yong Bakos junk at humanoriented.com
Thu Apr 7 14:39:42 UTC 2016


> On Apr 7, 2016, at 3:14 AM, Chokshi, Mitul <mitul.chokshi at intel.com> wrote:
> 
> 
> Used stream editor to replace " with \"
> 
> Signed-off-by: Mitul Chokshi <mitul.chokshi at intel.com>
> ---
> Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index d1644ac..a09ea0b 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -162,7 +162,7 @@ endif
> 
> if HAVE_GIT_REPO
> src/git-version.h : $(top_srcdir)/.git/logs/HEAD
> -	$(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)')\"" > $@
> +	$(AM_V_GEN)echo "#define BUILD_ID \"$(shell git --git-dir=$(top_srcdir)/.git describe --always --dirty) $(shell git --git-dir=$(top_srcdir)/.git log -1 --format='%s (%ci)' | $(SED) 's|\"|\\\"|g' )\"" > $@
> else
> src/git-version.h :
> 	$(AM_V_GEN)echo "#define BUILD_ID \"unknown (not built from git or tarball)\"" > $@
> -- 
> 1.9.1


Hi Mitul,
Thanks for the patch - it's something I've reviewed, but it took me time to
answer:

1) What repository/project is this for?
   Using a subject line of [PATCH weston] is preferred.
   Tip: git config --add format.subjectprefix "PATCH `basename $PWD`"

2) What problem does this fix?
   "A double-quote in a log message prematurely ends the enquoted string
   in src/git-version.h, causing an error during compilation."
   I know this is a simple patch, but writing a good commit message goes
   a long way in speeding up a review.

3) The maintainers prefer a short prefix for the first line of the commit
   message. eg: "makefile: Fix compilation error when..."

(btw, you're way more experienced than I am at this, so please forgive me
if you already know all this.)

Reviewed-by: Yong Bakos <ybakos at humanoriented.com>

yong



More information about the wayland-devel mailing list