1. 21 May, 2011 29 commits
  2. 15 May, 2011 4 commits
    • Ævar Arnfjörð Bjarmason's avatar
      Makefile: add xgettext target for *.sh files · adc3b2b2
      Ævar Arnfjörð Bjarmason authored
      Change the "pot" target to also extract strings from our $(SCRIPT_SH)
      files with xgettext(1).
      
      Note that due to Jonathan Nieder's trick of doing "mv $@+ $@" at the
      end of the target the "pot" target will now warn:
      
          $ make pot
              XGETTEXT po/git.pot
          po/git.pot+: warning: Charset "CHARSET" is not a portable encoding name.
                                Message conversion to user's charset might not work.
      
      This warnings is emitted because xgettext is writing into a non-*.pot
      file, it's harmless however. The content that's written out is
      equivalent to what it would be if we were writing directly into an
      existing POT file with --join-existing.
      
      As part of this change I've eliminated the && chain between xgettext
      calls, this is incompatible with $(QUIET_XGETTEXT), if the && is left
      in it'll emit:
      
          /bin/sh: @echo: not found
      
      Since it's redundant (the Makefile will stop if there's an error) I've
      removed it altogether.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      adc3b2b2
    • Ævar Arnfjörð Bjarmason's avatar
      git-sh-i18n.sh: add GIT_GETTEXT_POISON support · 64a42951
      Ævar Arnfjörð Bjarmason authored
      Change git-sh-i18n.sh to support the GIT_GETTEXT_POISON environment
      variable like gettext.c does, this ensures that tests that use
      git-sh-i18n.sh will fail under GETTEXT_POISON=YesPlease if they rely
      on Git's C locale messages without declaring that they do.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      64a42951
    • Ævar Arnfjörð Bjarmason's avatar
      git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers · e00cf070
      Ævar Arnfjörð Bjarmason authored
      Add a no-op wrapper library for Git's shell scripts. To split up the
      gettext series I'm first submitting patches to gettextize the source
      tree before I add any of the Makefile and Shell library changes needed
      to actually use them.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      e00cf070
    • Ævar Arnfjörð Bjarmason's avatar
      git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext() · ba67aaf2
      Ævar Arnfjörð Bjarmason authored
      Add a git-sh-i18n--envsubst program which is a stripped-down version
      of the GNU envsubst(1) program that comes with GNU gettext for use in
      the eval_gettext() fallback.
      
      We need a C helper program because implementing eval_gettext() purely
      in shell turned out to be unworkable. Digging through the Git mailing
      list archives will reveal two shell implementations of eval_gettext
      that are almost good enough, but fail on an edge case which is tested
      for in the tests which are part of this patch.
      
      These are the modifications I made to envsubst.c as I turned it into
      sh-i18n--envsubst.c:
      
       * Added our git-compat-util.h header for xrealloc() and friends.
      
       * Removed inclusion of gettext-specific headers.
      
       * Removed most of main() and replaced it with my own. The modified
         version only does option parsing for --variables. That's all it
         needs.
      
       * Modified error() invocations to use our error() instead of
         error(3).
      
       * Replaced the gettext XNMALLOC(n, size) macro with just
         xmalloc(n). Since XNMALLOC() only allocated char's.
      
       * Removed the string_list_destroy function. It's redundant (also in
         the upstream code).
      
       * Replaced the use of stdbool.h (a C99 header) by doing the following
         replacements on the code:
      
          * s/bool/unsigned short int/g
          * s/true/1/g
          * s/false/0/g
      Reported-by: default avatarJohannes Sixt <j.sixt@viscovery.net>
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      ba67aaf2
  3. 06 May, 2011 7 commits