git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] gettext: add gettextln, eval_gettextln to encode common idiom
@ 2011-08-07 11:58 Jon Seymour
  2011-08-07 11:58 ` [PATCH v2 1/5] " Jon Seymour
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
  To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour

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
	...

Applies cleanly to master and pu.

Revisions
=========
v2: 
	Split modifications to git-sh-i18n.sh into separate commit.
	Extended application to:
		 git-am.sh
		 git-pull.sh
		 git-stash.sh
		 git-submodule.sh
	Removed application to git-bisect.sh, pending stabilisation of this series and js/bisect-no-checkout in next or master.
	
v1: Initial RFC. Included example of application to git-bisect.sh.

Future
======
	Apply to git-bisect.sh

Jon Seymour (5):
  gettext: add gettextln, eval_gettextln to encode common idiom
  git-am: take advantage of gettextln and eval_gettextln.
  pull: take advantage of eval_gettextln
  stash: take advantage of eval_gettextln
  submodule: take advantage of gettextln and eval_gettextln.

 git-am.sh        |   31 ++++++++++++++-----------------
 git-pull.sh      |    7 ++-----
 git-sh-i18n.sh   |   19 +++++++++++++++++++
 git-stash.sh     |    9 +++------
 git-submodule.sh |   18 ++++++------------
 5 files changed, 44 insertions(+), 40 deletions(-)

-- 
1.7.6.363.g9b380.dirty

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

end of thread, other threads:[~2011-08-07 11:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-07 11:58 [PATCH v2 0/5] gettext: add gettextln, eval_gettextln to encode common idiom Jon Seymour
2011-08-07 11:58 ` [PATCH v2 1/5] " Jon Seymour
2011-08-07 11:58 ` [PATCH v2 2/5] git-am: take advantage of gettextln and eval_gettextln Jon Seymour
2011-08-07 11:58 ` [PATCH v2 3/5] pull: take advantage of eval_gettextln Jon Seymour
2011-08-07 11:58 ` [PATCH v2 4/5] stash: " Jon Seymour
2011-08-07 11:58 ` [PATCH v2 5/5] submodule: take advantage of gettextln and eval_gettextln Jon Seymour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).