Merge branch 'ab/c-translators-comment-style' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 5 Jun 2017 00:03:10 +0000 (09:03 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Jun 2017 00:03:10 +0000 (09:03 +0900)
Update the C style recommendation for notes for translators, as
recent versions of gettext tools can work with our style of
multi-line comments.

* ab/c-translators-comment-style:
C style: use standard style for "TRANSLATORS" comments

1  2 
Documentation/CodingGuidelines
bisect.c
sequencer.c
index 2248cf7324c712960db87cd96a4bb030d062cb81,9fd7383819930c89632e57c2694c318a2efca9bb..c4cb5ff0d477938b8fd49749c3589c5afbb04221
@@@ -24,7 -24,7 +24,7 @@@ code.  For Git in general, a few rough 
  
     "Once it _is_ in the tree, it's not really worth the patch noise to
     go and fix it up."
 -   Cf. http://article.gmane.org/gmane.linux.kernel/943020
 +   Cf. http://lkml.iu.edu/hypermail/linux/kernel/1001.3/01069.html
  
  Make your code readable and sensible, and don't try to be clever.
  
@@@ -256,12 -256,12 +256,12 @@@ For C programs
  
     Note however that a comment that explains a translatable string to
     translators uses a convention of starting with a magic token
-    "TRANSLATORS: " immediately after the opening delimiter, even when
-    it spans multiple lines.  We do not add an asterisk at the beginning
-    of each line, either.  E.g.
+    "TRANSLATORS: ", e.g.
  
-       /* TRANSLATORS: here is a comment that explains the string
-          to be translated, that follows immediately after it */
+       /*
+        * TRANSLATORS: here is a comment that explains the string to
+        * be translated, that follows immediately after it.
+        */
        _("Here is a translatable string explained by the above.");
  
   - Double negation is often harder to understand than no negation
diff --combined bisect.c
index fa477a3e2443121ab859d71bb21c382926ac3a21,c5d5a2b64befe41aed40f12e21deaae33adb9613..aaab6ada2b620e10af5dff2ea894ecf3d44ac9ea
+++ b/bisect.c
@@@ -546,7 -546,7 +546,7 @@@ static unsigned get_prn(unsigned count
  
  /*
   * Custom integer square root from
 - * http://en.wikipedia.org/wiki/Integer_square_root
 + * https://en.wikipedia.org/wiki/Integer_square_root
   */
  static int sqrti(int val)
  {
@@@ -995,8 -995,10 +995,10 @@@ int bisect_next_all(const char *prefix
  
        steps_msg = xstrfmt(Q_("(roughly %d step)", "(roughly %d steps)",
                  steps), steps);
-       /* TRANSLATORS: the last %s will be replaced with
-          "(roughly %d steps)" translation */
+       /*
+        * TRANSLATORS: the last %s will be replaced with "(roughly %d
+        * steps)" translation.
+        */
        printf(Q_("Bisecting: %d revision left to test after this %s\n",
                  "Bisecting: %d revisions left to test after this %s\n",
                  nr), nr, steps_msg);
diff --combined sequencer.c
index 4dcf9c8be044247c6c18a4ec2a4675d9df9953eb,b77f359ca294aa5c5e929a14a1af46a874c3ae68..8c72cf16145dc80edec90c6d4fb68811c0c65399
@@@ -464,7 -464,8 +464,8 @@@ static int do_recursive_merge(struct co
  
        if (active_cache_changed &&
            write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
-               /* TRANSLATORS: %s will be "revert", "cherry-pick" or
+               /*
+                * TRANSLATORS: %s will be "revert", "cherry-pick" or
                 * "rebase -i".
                 */
                return error(_("%s: Unable to write new index file"),
@@@ -1045,7 -1046,6 +1046,7 @@@ static int do_pick_commit(enum todo_com
                        strbuf_addstr(&msgbuf, p);
  
                if (opts->record_origin) {
 +                      strbuf_complete_line(&msgbuf);
                        if (!has_conforming_footer(&msgbuf, NULL, 0))
                                strbuf_addch(&msgbuf, '\n');
                        strbuf_addstr(&msgbuf, cherry_picked_prefix);
@@@ -1914,13 -1914,11 +1915,13 @@@ static int apply_autostash(struct repla
        strbuf_trim(&stash_sha1);
  
        child.git_cmd = 1;
 +      child.no_stdout = 1;
 +      child.no_stderr = 1;
        argv_array_push(&child.args, "stash");
        argv_array_push(&child.args, "apply");
        argv_array_push(&child.args, stash_sha1.buf);
        if (!run_command(&child))
 -              printf(_("Applied autostash."));
 +              printf(_("Applied autostash.\n"));
        else {
                struct child_process store = CHILD_PROCESS_INIT;
  
@@@ -2091,7 -2089,6 +2092,7 @@@ cleanup_head_ref
                                res = error(_("could not read orig-head"));
                                goto cleanup_head_ref;
                        }
 +                      strbuf_reset(&buf);
                        if (!read_oneliner(&buf, rebase_path_onto(), 0)) {
                                res = error(_("could not read 'onto'"));
                                goto cleanup_head_ref;
@@@ -2361,9 -2358,6 +2362,9 @@@ void append_signoff(struct strbuf *msgb
                                getenv("GIT_COMMITTER_EMAIL")));
        strbuf_addch(&sob, '\n');
  
 +      if (!ignore_footer)
 +              strbuf_complete_line(msgbuf);
 +
        /*
         * If the whole message buffer is equal to the sob, pretend that we
         * found a conforming footer with a matching sob
                         * the title and body to be filled in by the user.
                         */
                        append_newlines = "\n\n";
 -              } else if (msgbuf->buf[len - 1] != '\n') {
 -                      /*
 -                       * Incomplete line.  Complete the line and add a
 -                       * blank one so that there is an empty line between
 -                       * the message body and the sob.
 -                       */
 -                      append_newlines = "\n\n";
                } else if (len == 1) {
                        /*
                         * Buffer contains a single newline.  Add another