Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Aug 8, 2011
  1. Jon Seymour Junio C Hamano

    gettext: add gettextln, eval_gettextln to encode common idiom

    jonseymour authored gitster committed
    Currently, if you want to use gettext or eval_gettext to format a message
    you may have to add a separate echo statement and a surrounding subshell
    in order to interpolate the required trailing new line.
    
    This patch introduces two new helper functions, gettextln and eval_gettextln
    which append a trailing newline to the gettext output.
    
    This allows constructions of the form:
    
    	if test -s "$GIT_DIR/BISECT_START"
    	then
    		(
    			gettext "You need to give me at least one good and one bad revisions.
    (You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
    			echo
    		) >&2
    	else
    	...
    
    to be expressed more concisely as:
    
    	if test -s "$GIT_DIR/BISECT_START"
    	then
    		gettextln "You need to give me at least one good and one bad revisions.
    (You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
    	else
    	...
    
    Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.