<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/parse-options.c, branch v2.21.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.21.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.21.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-01-14T23:29:32Z</updated>
<entry>
<title>Merge branch 'nd/indentation-fix'</title>
<updated>2019-01-14T23:29:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-14T23:29:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2b6aa98be15458e4741274441541ee071e36f63'/>
<id>urn:sha1:f2b6aa98be15458e4741274441541ee071e36f63</id>
<content type='text'>
Code cleanup.

* nd/indentation-fix:
  Indent code with TABs
</content>
</entry>
<entry>
<title>Merge branch 'nd/i18n'</title>
<updated>2019-01-04T21:33:31Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-01-04T21:33:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3813a89faee3ecb111aa206f68b46618ec853e4e'/>
<id>urn:sha1:3813a89faee3ecb111aa206f68b46618ec853e4e</id>
<content type='text'>
More _("i18n") markings.

* nd/i18n:
  fsck: mark strings for translation
  fsck: reduce word legos to help i18n
  parse-options.c: mark more strings for translation
  parse-options.c: turn some die() to BUG()
  parse-options: replace opterror() with optname()
  repack: mark more strings for translation
  remote.c: mark messages for translation
  remote.c: turn some error() or die() to BUG()
  reflog: mark strings for translation
  read-cache.c: add missing colon separators
  read-cache.c: mark more strings for translation
  read-cache.c: turn die("internal error") to BUG()
  attr.c: mark more string for translation
  archive.c: mark more strings for translation
  alias.c: mark split_cmdline_strerror() strings for translation
  git.c: mark more strings for translation
</content>
</entry>
<entry>
<title>Merge branch 'nd/show-gitcomp-compilation-fix' into maint</title>
<updated>2018-12-15T03:24:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-12-15T03:24:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf29f074ed7019abb53398c4cd5659d9f939d9a8'/>
<id>urn:sha1:bf29f074ed7019abb53398c4cd5659d9f939d9a8</id>
<content type='text'>
Portability fix for a recent update to parse-options API.

* nd/show-gitcomp-compilation-fix:
  parse-options: fix SunCC compiler warning
</content>
</entry>
<entry>
<title>parse-options: fix SunCC compiler warning</title>
<updated>2018-12-12T08:21:33Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-12-11T15:35:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc'/>
<id>urn:sha1:a92ec7efe0ad25f1c2047230c0324dcb54ce1cfc</id>
<content type='text'>
The compiler reports this because show_gitcomp() never actually
returns a value:

    "parse-options.c", line 520: warning: Function has no return
    statement : show_gitcomp

We could shut the compiler up. But instead let's not bury exit() too
deep. Do the same as internal -h handling, return a special error code
and handle the exit() in parse_options() (and other
parse_options_step() callers) instead.

Reported-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Indent code with TABs</title>
<updated>2018-12-09T03:37:32Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-12-06T15:42:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec36c42a6301eca8a1a038001435bc8a7940e886'/>
<id>urn:sha1:ec36c42a6301eca8a1a038001435bc8a7940e886</id>
<content type='text'>
We indent with TABs and sometimes for fine alignment, TABs followed by
spaces, but never all spaces (unless the indentation is less than 8
columns). Indenting with spaces slips through in some places. Fix
them.

Imported code and compat/ are left alone on purpose. The former should
remain as close as upstream as possible. The latter pretty much has
separate maintainers, it's up to them to decide.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options.c: mark more strings for translation</title>
<updated>2018-11-12T05:47:10Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-10T05:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8900342628c1c0c52dff62edaa2ee73d82287f2d'/>
<id>urn:sha1:8900342628c1c0c52dff62edaa2ee73d82287f2d</id>
<content type='text'>
One error is updated to start with lowercase to be consistent with the
rest.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options.c: turn some die() to BUG()</title>
<updated>2018-11-12T05:47:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-10T05:16:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=48a5499ef50d4d49ac78e1711535bebf3d5b3cfb'/>
<id>urn:sha1:48a5499ef50d4d49ac78e1711535bebf3d5b3cfb</id>
<content type='text'>
These two strings are clearly not for the user to see. Reduce the
violence in one string while at there.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>parse-options: replace opterror() with optname()</title>
<updated>2018-11-12T05:47:09Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2018-11-10T05:16:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9440b831ad5b1750b65fa3f1d0b99179ab317c76'/>
<id>urn:sha1:9440b831ad5b1750b65fa3f1d0b99179ab317c76</id>
<content type='text'>
Introduce optname() that does the early half of original opterror() to
come up with the name of the option reported back to the user, and use
it to kill opterror().  The callers of opterror() now directly call
error() using the string returned by opterror() instead.

There are a few issues with opterror()

- it tries to assemble an English sentence from pieces. This is not
  great for translators because we give them pieces instead of a full
  sentence.

- It's a wrapper around error() and needs some hack to let the
  compiler know it always returns -1.

- Since it takes a string instead of printf format, one call site has
  to assemble the string manually before passing to it.

Using error() directly solves the second and third problems.

It kind helps the first problem as well because "%s does foo" does
give a translator a full sentence in a sense and let them reorder if
needed. But it has limitations, if the subject part has to change
based on the rest of the sentence, that language is screwed. This is
also why I try to avoid calling optname() when 'flags' is known in
advance.

Mark of these strings for translation as well while at there.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/parse-opt-lithelp'</title>
<updated>2018-08-17T20:09:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-08-17T20:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8963bb0c2d023738f8ea021b512ed83cd79ee754'/>
<id>urn:sha1:8963bb0c2d023738f8ea021b512ed83cd79ee754</id>
<content type='text'>
The parse-options machinery learned to refrain from enclosing
placeholder string inside a "&lt;bra" and "ket&gt;" pair automatically
without PARSE_OPT_LITERAL_ARGHELP.  Existing help text for option
arguments that are not formatted correctly have been identified and
fixed.

* rs/parse-opt-lithelp:
  parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP
  shortlog: correct option help for -w
  send-pack: specify --force-with-lease argument help explicitly
  pack-objects: specify --index-version argument help explicitly
  difftool: remove angular brackets from argument help
  add, update-index: fix --chmod argument help
  push: use PARSE_OPT_LITERAL_ARGHELP instead of unbalanced brackets
</content>
</entry>
<entry>
<title>parse-options: automatically infer PARSE_OPT_LITERAL_ARGHELP</title>
<updated>2018-08-03T15:36:20Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2018-08-02T19:18:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f0df44cd79a953c287ccb598896ea7aaa2cc9e3'/>
<id>urn:sha1:5f0df44cd79a953c287ccb598896ea7aaa2cc9e3</id>
<content type='text'>
Parseopt wraps argument help strings in a pair of angular brackets by
default, to tell users that they need to replace it with an actual
value.  This is useful in most cases, because most option arguments
are indeed single values of a certain type.  The option
PARSE_OPT_LITERAL_ARGHELP needs to be used in option definitions with
arguments that have multiple parts or are literal strings.

Stop adding these angular brackets if special characters are present,
as they indicate that we don't deal with a simple placeholder.  This
simplifies the code a bit and makes defining special options slightly
easier.

Remove the flag PARSE_OPT_LITERAL_ARGHELP in the cases where the new
and more cautious handling suffices.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
