Skip to contentSkip to conversation

correct a few doubled-word nits in comments and documentation

PATCH In review Jim Meyering 3 participants 4 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 correct a few doubled-word nits in comments and documentation

Found by running this command:

$ git ls-files -z|xargs -0 perl -0777 -n \
 -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
 -e '  {' \
 -e '    $n = ($` =~ tr/\n/\n/ + 1);' \
 -e '    ($v = $&) =~ s/\n/\\n/g;' \
 -e '    print "$ARGV:$n:$v\n";' \
 -e '  }'

Why not just git grep -E ...?
That wouldn't work then the doubled words are separated by a newline. This is derived from a Makefile syntax-check rule in gnulib's maint.mk:
http://git.sv.gnu.org/cgit/gnulib.git/tree/top/maint.mk

---
 Documentation/git-sh-i18n--envsubst.txt |    2 +-
 attr.h                                  |    2 +-
 gitweb/static/js/lib/cookies.js         |    2 +-
 po/README                               |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Documentation/git-sh-i18n--envsubst.txt +1 -1
index 5c3ec32..2ffaf93 100644
@@ -25,7 +25,7 @@ plumbing scripts and/or are writing new ones.
 'git sh-i18n{litdd}envsubst' is Git's stripped-down copy of the GNU
 `envsubst(1)` program that comes with the GNU gettext package. It's
 used internally by linkgit:git-sh-i18n[1] to interpolate the variables
-passed to the the `eval_gettext` function.
+passed to the `eval_gettext` function.
 
 No promises are made about the interface, or that this
 program won't disappear without warning in the next version
attr.h +1 -1
index eb8ca0d..dea590a 100644
@@ -40,7 +40,7 @@ int git_check_attr(const char *path, int, struct git_attr_check *);
 
 /*
  * Retrieve all attributes that apply to the specified path.  *num
- * will be set the the number of attributes on the path; **check will
+ * will be set the number of attributes on the path; **check will
  * be set to point at a newly-allocated array of git_attr_check
  * objects describing the attributes and their values.  *check must be
  * free()ed by the caller.
gitweb/static/js/lib/cookies.js +1 -1
index 72b51cd..66b9a07 100644
@@ -30,7 +30,7 @@
  *                            If a negative value is specified or a date in the past),
  *                            the cookie will be deleted.
  *                            If set to null or omitted, the cookie will be a session cookie
- *                            and will not be retained when the the browser exits.
+ *                            and will not be retained when the browser exits.
  * @param {String} [options.path] Restrict access of a cookie to particular directory
  *                               (default: path of page that created the cookie).
  * @param {String} [options.domain] Override what web sites are allowed to access cookie
po/README +1 -1
index 188ea2c..c1520e8 100644
@@ -178,7 +178,7 @@ used:
 
 C:
 
- - Include builtin.h at the top, it'll pull in in gettext.h, which
+ - Include builtin.h at the top, it'll pull in gettext.h, which
    defines the gettext interface. Consult with the list if you need to
    use gettext.h directly.
 

--
1.7.9.3

Quoted 1 line

From e887bda34232bd3cfb63f6a65e534fa14cfa42ca Mon Sep 17 00:00:00 2001

From: Jim Meyering <[email protected]>
Date: Wed, 28 Mar 2012 10:34:28 +0200
Subject: [PATCH 2/2] correct spelling: an URL -> a URL

---
 Documentation/git-submodule.txt             |    2 +-
 Documentation/gitmodules.txt                |    4 ++--
 Documentation/howto/using-merge-subtree.txt |    2 +-
 contrib/svn-fe/svn-fe.txt                   |    2 +-
 http.c                                      |    2 +-
 http.h                                      |    2 +-
 perl/Git.pm                                 |    2 +-
 transport.c                                 |    2 +-
 8 files changed, 9 insertions(+), 9 deletions(-)
Documentation/git-submodule.txt +1 -1
index b729649..c243ee5 100644
@@ -190,7 +190,7 @@ commit for each submodule.
 sync::
 	Synchronizes submodules' remote URL configuration setting
 	to the value specified in .gitmodules. It will only affect those
-	submodules which already have an url entry in .git/config (that is the
+	submodules which already have a URL entry in .git/config (that is the
 	case when they are initialized or freshly added). This is useful when
 	submodule URLs change upstream and you need to update your local
 	repositories accordingly.
Documentation/gitmodules.txt +2 -2
index 4040941..4e1fd52 100644
@@ -28,7 +28,7 @@ submodule.<name>.path::
 	be unique within the .gitmodules file.
 
 submodule.<name>.url::
-	Defines an url from where the submodule repository can be cloned.
+	Defines a URL from which the submodule repository can be cloned.
 	This may be either an absolute URL ready to be passed to
 	linkgit:git-clone[1] or (if it begins with ./ or ../) a location
 	relative to the superproject's origin repository.
@@ -84,7 +84,7 @@ Consider the following .gitmodules file:
 
 This defines two submodules, `libfoo` and `libbar`. These are expected to
 be checked out in the paths 'include/foo' and 'include/bar', and for both
-submodules an url is specified which can be used for cloning the submodules.
+submodules a URL is specified which can be used for cloning the submodules.
 
 SEE ALSO
 --------
Documentation/howto/using-merge-subtree.txt +1 -1
index 2933056..1ae8d12 100644
@@ -25,7 +25,7 @@ What you want is the 'subtree' merge strategy, which helps you in such a
 situation.
 
 In this example, let's say you have the repository at `/path/to/B` (but
-it can be an URL as well, if you want). You want to merge the 'master'
+it can be a URL as well, if you want). You want to merge the 'master'
 branch of that repository to the `dir-B` subdirectory in your current
 branch.
 
contrib/svn-fe/svn-fe.txt +1 -1
index 2dd27ce..1128ab2 100644
@@ -51,7 +51,7 @@ as committer, where 'user' is the value of the `svn:author` property
 and 'UUID' the repository's identifier.
 
 To support incremental imports, 'svn-fe' puts a `git-svn-id` line at
-the end of each commit log message if passed an url on the command
+the end of each commit log message if passed a URL on the command
 line.  This line has the form `git-svn-id: URL@REVNO UUID`.
 
 The resulting repository will generally require further processing
http.c +1 -1
index 8ac8eb6..f3f83d7 100644
@@ -829,7 +829,7 @@ int http_get_strbuf(const char *url, struct strbuf *result, int options)
 }
 
 /*
- * Downloads an url and stores the result in the given file.
+ * Downloads a URL and stores the result in the given file.
  *
  * If a previous interrupted download is detected (i.e. a previous temporary
  * file is still around) the download is resumed.
http.h +1 -1
index 0b61653..915c286 100644
@@ -127,7 +127,7 @@ extern char *get_remote_object_url(const char *url, const char *hex,
 #define HTTP_NOAUTH	5
 
 /*
- * Requests an url and stores the result in a strbuf.
+ * Requests a URL and stores the result in a strbuf.
  *
  * If the result pointer is NULL, a HTTP HEAD request is made instead of GET.
  */
perl/Git.pm +1 -1
index f7ce511..497f420 100644
@@ -691,7 +691,7 @@ The hash is in the format C<refname =\> hash>. For tags, the C<refname> entry
 contains the tag object while a C<refname^{}> entry gives the tagged objects.
 
 C<REPOSITORY> has the same meaning as the appropriate C<git-ls-remote>
-argument; either an URL or a remote name (if called on a repository instance).
+argument; either a URL or a remote name (if called on a repository instance).
 C<GROUPS> is an optional arrayref that can contain 'tags' to return all the
 tags and/or 'heads' to return all the heads. C<REFGLOB> is an optional array
 of strings containing a shell-like glob to further limit the refs returned in
transport.c +1 -1
index 181f8f2..ea9dcb6 100644
@@ -1154,7 +1154,7 @@ int transport_disconnect(struct transport *transport)
 }
 
 /*
- * Strip username (and password) from an url and return
+ * Strip username (and password) from a URL and return
  * it in a newly allocated string.
  */
 char *transport_anonymize_url(const char *url)

--
1.7.9.3

#1 lore raw

Thanks; by the way, you have an extra patch message concatenated after the main one.

#2 lore raw

PATCH 1/1 correct a few doubled-word nits in comments and documentation

Found by running this command:

$ git ls-files -z|xargs -0 perl -0777 -n \
 -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
 -e '  {' \
 -e '    $n = ($` =~ tr/\n/\n/ + 1);' \
 -e '    ($v = $&) =~ s/\n/\\n/g;' \
 -e '    print "$ARGV:$n:$v\n";' \
 -e '  }'

---

Quoted 2 lines

Thanks; by the way, you have an extra patch message concatenated after the main one.

Sorry about that. In case it helps, here's a better version.

 Documentation/git-sh-i18n--envsubst.txt |    2 +-
 attr.h                                  |    2 +-
 gitweb/static/js/lib/cookies.js         |    2 +-
 po/README                               |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Documentation/git-sh-i18n--envsubst.txt +1 -1
index 5c3ec32..2ffaf93 100644
@@ -25,7 +25,7 @@ plumbing scripts and/or are writing new ones.
 'git sh-i18n{litdd}envsubst' is Git's stripped-down copy of the GNU
 `envsubst(1)` program that comes with the GNU gettext package. It's
 used internally by linkgit:git-sh-i18n[1] to interpolate the variables
-passed to the the `eval_gettext` function.
+passed to the `eval_gettext` function.
 
 No promises are made about the interface, or that this
 program won't disappear without warning in the next version
attr.h +1 -1
index eb8ca0d..dea590a 100644
@@ -40,7 +40,7 @@ int git_check_attr(const char *path, int, struct git_attr_check *);
 
 /*
  * Retrieve all attributes that apply to the specified path.  *num
- * will be set the the number of attributes on the path; **check will
+ * will be set the number of attributes on the path; **check will
  * be set to point at a newly-allocated array of git_attr_check
  * objects describing the attributes and their values.  *check must be
  * free()ed by the caller.
gitweb/static/js/lib/cookies.js +1 -1
index 72b51cd..66b9a07 100644
@@ -30,7 +30,7 @@
  *                            If a negative value is specified or a date in the past),
  *                            the cookie will be deleted.
  *                            If set to null or omitted, the cookie will be a session cookie
- *                            and will not be retained when the the browser exits.
+ *                            and will not be retained when the browser exits.
  * @param {String} [options.path] Restrict access of a cookie to particular directory
  *                               (default: path of page that created the cookie).
  * @param {String} [options.domain] Override what web sites are allowed to access cookie
po/README +1 -1
index 188ea2c..c1520e8 100644
@@ -178,7 +178,7 @@ used:
 
 C:
 
- - Include builtin.h at the top, it'll pull in in gettext.h, which
+ - Include builtin.h at the top, it'll pull in gettext.h, which
    defines the gettext interface. Consult with the list if you need to
    use gettext.h directly.
 

--
1.7.9.3

#3 lore raw

(+cc: Ævar for a side note marked with (*) below)
Hi,

Quoted 8 lines · Jim Meyering

Found by running this command:

$ git ls-files -z|xargs -0 perl -0777 -n \
 -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
 -e '  {' \
 -e '    $n = ($` =~ tr/\n/\n/ + 1);' \
 -e '    ($v = $&) =~ s/\n/\\n/g;' \
 -e '    print "$ARGV:$n:$v\n";' \
 -e '  }'

Yeah, this often happens when a person returns to writing after being interrupted in the middle of a train of thought.

[...]

Quoted 2 lines

+++ b/Documentation/git-sh-i18n--envsubst.txt

(quoted diff) +0 -0
@@ -25,7 +25,7 @@ plumbing scripts and/or are writing new ones.

[...]

Review

Quoted 3 lines

used internally by linkgit:git-sh-i18n[1] to interpolate the variables

(quoted diff) +1 -1
-passed to the the `eval_gettext` function.
+passed to the `eval_gettext` function.

Good catch.

[...]

Review int git_check_attr(const char *path, int, struct git_attr_check *); · line 43

Quoted 7 lines

+++ b/attr.h

(quoted diff) +1 -1
@@ -40,7 +40,7 @@ int git_check_attr(const char *path, int, struct git_attr_check *);
 
 /*
  * Retrieve all attributes that apply to the specified path.  *num
- * will be set the the number of attributes on the path; **check will
+ * will be set the number of attributes on the path; **check will

Shouldn't this say "to the"?

[...]

Review line 31

Quoted 5 lines
(quoted diff) +2 -1
+++ b/gitweb/static/js/lib/cookies.js
@@ -30,7 +30,7 @@
  *                            If set to null or omitted, the cookie will be a session cookie
- *                            and will not be retained when the the browser exits.
+ *                            and will not be retained when the browser exits.

Looks good.

[...]

Review used: · line 183

Quoted 9 lines
(quoted diff) +2 -1
+++ b/po/README
@@ -178,7 +178,7 @@ used:
 
 C:
 
- - Include builtin.h at the top, it'll pull in in gettext.h, which
+ - Include builtin.h at the top, it'll pull in gettext.h, which
    defines the gettext interface. Consult with the list if you need to
    use gettext.h directly.

Not related to this patch, but the sentence is a comma splice. I'm also not convinced that #include-ing builtin.h is actually a good idea when you are not defining or using functions declared in that header. (*)

But that's all orthogonal to your patch, so looks good.

Patch for squashing in follows.

Thanks,
Jonathan

attr.h +1 -1
index dea590a7..8b08d33a 100644
@@ -40,7 +40,7 @@ int git_check_attr(const char *path, int, struct git_attr_check *);
 
 /*
  * Retrieve all attributes that apply to the specified path.  *num
- * will be set the number of attributes on the path; **check will
+ * will be set to the number of attributes on the path; **check will
  * be set to point at a newly-allocated array of git_attr_check
  * objects describing the attributes and their values.  *check must be
  * free()ed by the caller.