diff mbox series

[v2,03/11] Prefer 'up-to-date' spelling

Message ID 466aead9af6516ff94a5d217e58ab894e63088b7.1572973651.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Thyme two ficks sum Documentaton tyops and speling erors! | expand

Commit Message

Linus Arver via GitGitGadget Nov. 5, 2019, 5:07 p.m. UTC
From: Elijah Newren <newren@gmail.com>

When we are providing an English error message for users, we should
avoid 'uptodate'.  According to
https://writingexplained.org/up-to-date-hyphenated, when used as an
adjective (i.e. when used as a synonym for 'current') -- which matches
our usage -- the correct spelling is up-to-date.  (Alternatively, when
used as an adverb, the same page points out it is spelled 'up to date'.)
In either case, when providing an English error message for users, we
shouldn't use 'uptodate'.  Correct the spelling.

Reported-by: Jens Schleusener <Jens.Schleusener@fossies.org>
Signed-off-by: Elijah Newren <newren@gmail.com>
---
 builtin/fetch.c                | 2 +-
 gitk-git/gitk                  | 2 +-
 t/t7110-reset-merge.sh         | 4 ++--
 t/t7609-merge-co-error-msgs.sh | 2 +-
 unpack-trees.c                 | 6 +++---
 5 files changed, 8 insertions(+), 8 deletions(-)

Comments

Junio C Hamano Nov. 7, 2019, 5:11 a.m. UTC | #1
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

>  gitk-git/gitk                  | 2 +-
> ...
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index abe4805ade..50a5b60c13 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -9696,7 +9696,7 @@ proc cherrypick {} {
>      if {[catch {exec sh -c "git cherry-pick -r $rowmenuid 2>&1"} err]} {
>  	notbusy cherrypick
>  	if {[regexp -line \
> -		 {Entry '(.*)' (would be overwritten by merge|not uptodate)} \
> +		 {Entry '(.*)' (would be overwritten by merge|not up-to-date)} \
>  		 $err msg fname]} {
>  	    error_popup [mc "Cherry-pick failed because of local changes\
>  			to file '%s'.\nPlease commit, reset or stash\

Not very satisfactory for two reasons.

Procedurally, I'd strongly prefer to see any patch that touches
"gitk" (and similarly "git-gui" and "po") to be separated from the
rest, and not directly sent to me.  Further, "gitk" is merged
one-way into my tree with -Xsubtree=gitk (similarly for "git-gui"),
so a patch to it would be to change "a/gitk" to "b/gitk".

Content-wise, because "gitk" (and similarly "git-gui") is a project
that stands on its own, we (at least this is a wish by its primary
author and maintainer the last time I checked with him) want to make
sure that slightly older/newer gitk is interoperable with slightly
newer/older git.  Preparing to also see "uptodate" emitted by the
version of git it runs would be a good way to achieve this.

We do not promise interoperability between vastly different versions
forever, by the way.  I see "cherry-pick -r" used in the precontext,
but "--replay" has been the default for the command for the past
dozen years, and now it is just an unadvertised noop.  It probably
is OK now to remove "-r" from the invocation here ;-)

Thanks.
Junio C Hamano Nov. 7, 2019, 5:16 a.m. UTC | #2
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> diff --git a/unpack-trees.c b/unpack-trees.c
> index 33ea7810d8..8ba2dc3267 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -29,7 +29,7 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] 
>  	"Entry '%s' would be overwritten by merge. Cannot merge.",
>  
>  	/* ERROR_NOT_UPTODATE_FILE */
> -	"Entry '%s' not uptodate. Cannot merge.",
> +	"Entry '%s' not up-to-date. Cannot merge.",

As the name of this table says, this is a table of the plumbing
errors that are given without translation, in order to allow scripts
to read and act on them.  Wouldn't touching it break the promise to
the scripts?
Elijah Newren Nov. 7, 2019, 5:01 p.m. UTC | #3
On Wed, Nov 6, 2019 at 9:16 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > diff --git a/unpack-trees.c b/unpack-trees.c
> > index 33ea7810d8..8ba2dc3267 100644
> > --- a/unpack-trees.c
> > +++ b/unpack-trees.c
> > @@ -29,7 +29,7 @@ static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES]
> >       "Entry '%s' would be overwritten by merge. Cannot merge.",
> >
> >       /* ERROR_NOT_UPTODATE_FILE */
> > -     "Entry '%s' not uptodate. Cannot merge.",
> > +     "Entry '%s' not up-to-date. Cannot merge.",
>
> As the name of this table says, this is a table of the plumbing
> errors that are given without translation, in order to allow scripts
> to read and act on them.  Wouldn't touching it break the promise to
> the scripts?

Oh, right.  Between this and the gitk issues, how about we just drop
this patch and include the rest of the series.  Would you rather just
drop it on your end, or do you want me to send a re-roll that doesn't
include it?
diff mbox series

Patch

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 863c858fde..d597fa5be0 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -604,7 +604,7 @@  static void adjust_refcol_width(const struct ref *ref)
 {
 	int max, rlen, llen, len;
 
-	/* uptodate lines are only shown on high verbosity level */
+	/* up-to-date lines are only shown on high verbosity level */
 	if (!verbosity && oideq(&ref->peer_ref->old_oid, &ref->old_oid))
 		return;
 
diff --git a/gitk-git/gitk b/gitk-git/gitk
index abe4805ade..50a5b60c13 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -9696,7 +9696,7 @@  proc cherrypick {} {
     if {[catch {exec sh -c "git cherry-pick -r $rowmenuid 2>&1"} err]} {
 	notbusy cherrypick
 	if {[regexp -line \
-		 {Entry '(.*)' (would be overwritten by merge|not uptodate)} \
+		 {Entry '(.*)' (would be overwritten by merge|not up-to-date)} \
 		 $err msg fname]} {
 	    error_popup [mc "Cherry-pick failed because of local changes\
 			to file '%s'.\nPlease commit, reset or stash\
diff --git a/t/t7110-reset-merge.sh b/t/t7110-reset-merge.sh
index a82a07a04a..d81a27f3b0 100755
--- a/t/t7110-reset-merge.sh
+++ b/t/t7110-reset-merge.sh
@@ -173,7 +173,7 @@  test_expect_success 'reset --merge fails with changes in file it touches' '
     sed -e "s/line 1/changed line 1/" <file1 >file3 &&
     mv file3 file1 &&
     test_must_fail git reset --merge HEAD^ 2>err.log &&
-    grep file1 err.log | grep "not uptodate"
+    grep file1 err.log | grep "not up-to-date"
 '
 
 # The next test will test the following:
@@ -189,7 +189,7 @@  test_expect_success 'reset --keep fails with changes in file it touches' '
     sed -e "s/line 1/changed line 1/" <file1 >file3 &&
     mv file3 file1 &&
     test_must_fail git reset --keep HEAD^ 2>err.log &&
-    grep file1 err.log | grep "not uptodate"
+    grep file1 err.log | grep "not up-to-date"
 '
 
 test_expect_success 'setup 3 different branches' '
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh
index e90413204e..111253ae5d 100755
--- a/t/t7609-merge-co-error-msgs.sh
+++ b/t/t7609-merge-co-error-msgs.sh
@@ -98,7 +98,7 @@  Please commit your changes or stash them before you switch branches.
 Aborting
 EOF
 
-test_expect_success 'not uptodate file porcelain checkout error' '
+test_expect_success 'not up-to-date file porcelain checkout error' '
 	git add rep/one rep/two &&
 	test_must_fail git checkout branch 2>out &&
 	test_i18ncmp out expect
diff --git a/unpack-trees.c b/unpack-trees.c
index 33ea7810d8..8ba2dc3267 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -29,7 +29,7 @@  static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
 	"Entry '%s' would be overwritten by merge. Cannot merge.",
 
 	/* ERROR_NOT_UPTODATE_FILE */
-	"Entry '%s' not uptodate. Cannot merge.",
+	"Entry '%s' not up-to-date. Cannot merge.",
 
 	/* ERROR_NOT_UPTODATE_DIR */
 	"Updating '%s' would lose untracked files in it",
@@ -44,7 +44,7 @@  static const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = {
 	"Entry '%s' overlaps with '%s'.  Cannot bind.",
 
 	/* ERROR_SPARSE_NOT_UPTODATE_FILE */
-	"Entry '%s' not uptodate. Cannot update sparse checkout.",
+	"Entry '%s' not up-to-date. Cannot update sparse checkout.",
 
 	/* ERROR_WOULD_LOSE_ORPHANED_OVERWRITTEN */
 	"Working tree file '%s' would be overwritten by sparse checkout update.",
@@ -2027,7 +2027,7 @@  static int merged_entry(const struct cache_entry *ce,
 	} else if (!(old->ce_flags & CE_CONFLICTED)) {
 		/*
 		 * See if we can re-use the old CE directly?
-		 * That way we get the uptodate stat info.
+		 * That way we get the up-to-date stat info.
 		 *
 		 * This also removes the UPDATE flag on a match; otherwise
 		 * we will end up overwriting local changes in the work tree.