git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 0/2] normalize & fix merge "up to date" messages

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 2, 2021, 05:14 UTC
Message-ID
<20210502051423.48123-1-sunshine@sunshineco.com>
In-Reply-To
<pull.934.v3.git.1619052906768.gitgitgadget@gmail.com>

This is a re-roll of Josh Soref's v3[1] which fixes swapped components of an "Already up to date" message emitted by builtin/merge. This re-roll additionally normalizes punctuation of "Already up to date" messages throughout the project.

I kept Josh as author of patch [2/2] but completely rewrote the commit message to refocus it is a simple fix for a nearly 13 year old bug.

[1]: https://lore.kernel.org/git/pull.934.v3.git.1619052906768.gitgitgadget@gmail.com/
Eric Sunshine (1):
  merge(s): apply consistent punctuation to "up to date" messages
Josh Soref (1):
  merge: fix swapped "up to date" message components
 builtin/merge.c      | 14 +++++++++-----
 merge-ort-wrappers.c |  2 +-
 merge-recursive.c    |  2 +-
 notes-merge.c        |  2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)
Range-diff against v3:
-:  ---------- > 1:  3f96947e3a merge(s): apply consistent punctuation to "up to date" messages
1:  8cd2b8c335 ! 2:  5885b18b7f git-merge: rewrite already up to date message
    @@ Metadata
     Author: Josh Soref <jsoref@gmail.com>
     
      ## Commit message ##
    -    git-merge: rewrite already up to date message
    +    merge: fix swapped "up to date" message components
     
    -    Usually, it is easier to read a message if it makes its primary
    -    point first, before giving a parenthetical note.
    +    The rewrite of git-merge from shell to C in 1c7b76be7d (Build in merge,
    +    2008-07-07) accidentally transformed the message:
     
    -    Possible messages before include:
    -    ` (nothing to squash)Already up to date.
    -    `
    -    and
    -    `Already up to date. Yeeah!
    -    `
    +        Already up-to-date. (nothing to squash)
     
    -    After:
    -    `Already up to date (nothing to squash).
    -    `
    -    and
    -    `Already up to date.
    -    `
    +    to:
     
    -    Localizations now have two easy to understand translatable strings.
    -    (All localizations of the previous strings are broken.)
    +        (nothing to squash)Already up-to-date.
    +
    +    due to reversed printf() arguments. This problem has gone unnoticed
    +    despite being touched over the years by 7f87aff22c (Teach/Fix pull/fetch
    +    -q/-v options, 2008-11-15) and bacec47845 (i18n: git-merge basic
    +    messages, 2011-02-22), and tangentially by bef4830e88 (i18n: merge: mark
    +    messages for translation, 2016-06-17) and 7560f547e6 (treewide: correct
    +    several "up-to-date" to "up to date", 2017-08-23).
    +
    +    Fix it by restoring the message to its intended order. While at it, help
    +    translators out by avoiding "sentence Lego".
    +
    +    [es: rewrote commit message]
     
         Co-authored-by: Eric Sunshine <sunshine@sunshineco.com>
         Signed-off-by: Josh Soref <jsoref@gmail.com>
    +    Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
     
      ## builtin/merge.c ##
     @@ builtin/merge.c: static void restore_state(const struct object_id *head,
    @@ builtin/merge.c: static void restore_state(const struct object_id *head,
     -		printf("%s%s\n", squash ? _(" (nothing to squash)") : "", msg);
     +	if (verbosity >= 0) {
     +		if (squash)
    -+			puts(_("Already up to date (nothing to squash)."));
    ++			puts(_("Already up to date. (nothing to squash)"));
     +		else
     +			puts(_("Already up to date."));
     +	}
    @@ builtin/merge.c: int cmd_merge(int argc, const char **argv, const char *prefix)
      			}
      		}
      		if (up_to_date) {
    --			finish_up_to_date(_("Already up to date. Yeeah!"));
    +-			finish_up_to_date(_("Already up to date."));
     +			finish_up_to_date();
      			goto done;
      		}
-- 
2.31.1.607.g51e8a6a459
Previous: Eric SunshineNext: Eric Sunshine
Message 14 of 19 in “git-merge: move space to between strings”
  1. git-merge: move space to between stringsJosh Soref via GitGitGadget, Apr 18, 2021
  2. Junio C HamanoApr 18, 2021
  3. git-merge: move primary point before parentheticalJosh Soref via GitGitGadget, Apr 21, 2021
  4. Eric SunshineApr 21, 2021
  5. git-merge: rewrite already up to date messageJosh Soref via GitGitGadget, Apr 22, 2021
  6. Eric SunshineApr 22, 2021
  7. Junio C HamanoApr 28, 2021
  8. Junio C HamanoApr 29, 2021
  9. Josh SorefMay 2, 2021
  10. Eric SunshineMay 2, 2021
  11. Junio C HamanoMay 2, 2021
  12. Junio C HamanoMay 2, 2021
  13. Eric SunshineMay 2, 2021
  14. 0/2 normalize & fix merge "up to date" messagesEric Sunshine, May 2, 2021
  15. 2/2 merge: fix swapped "up to date" message componentsEric Sunshine, May 2, 2021
  16. Junio C HamanoMay 3, 2021
  17. Eric SunshineMay 3, 2021
  18. Junio C HamanoMay 3, 2021
  19. 1/2 merge(s): apply consistent punctuation to "up to date" messagesEric Sunshine, May 2, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.