Commit Graph

7 Commits

Author SHA1 Message Date
Chris Darroch
04abbd8436 make additional message strings translatable
Following on from the changes in PR #4781, we can make
additional message strings translatable using the
tr.Tr.Get() method.

Because this method performs printf(3)-style format string
parsing and interpolation, we can simplify some of the
surrounding calls, e.g., from fmt.Errorf() to errors.New(),
and from fmt.Fprintf() to fmt.Fprintln().  This ensures
that if either the translated text or any interpolated
arguments happen to contain character sequences that would
be interpreted as Go format specifiers (e.g., "%s" or "%d"),
these will not result in warnings such as "%!s(MISSING)"
in the output text.

Note also that we try to remove newlines from the message
strings were possible and change the surrounding calls to
append them instead, e.g., with fmt.Fprintln().
2022-01-29 22:36:19 -08:00
Chris Darroch
ed3decf753 use backticks around commands in messages
A number of message strings contain embedded Git or Git LFS
commands, and while in many cases these are already delimited
with backticks, in other cases they are not.

We therefore rework the formatting of these messages to accord
with the general practice of using backticks to delimit "git"
and "git lfs" commands.

In one case for the "git lfs clone" command this requires us
to split a multi-line message into several parts, but that
also has the advantage that we can move some of the fixed
formatting and newlines out of the translatable message strings.

Note that some of these messages are not yet passed as translation
strings, but we will address that issue in a subsequent commit.
2022-01-29 22:35:10 -08:00
brian m. carlson
cd1577af24
post-checkout: don't modify permissions of untracked files
Git doesn't know about untracked files, so we should avoid modifying
them when we adjust permissions in the post-checkout hook.  Add an
option to our invocation of git ls-files that controls the use of the
--others flag (which controls listing untracked files), and disable it
when we're looking for files to process with the post-checkout hook.
2021-12-06 13:44:33 +00:00
brian m. carlson
087db1de70
Set package version to v3
Since we're about to do a v3.0.0 release, let's bump the version to v3.

Make this change automatically with the following command to avoid any
missed items:

  git grep -l github.com/git-lfs/git-lfs/v2 | \
  xargs sed -i -e 's!github.com/git-lfs/git-lfs/v2!github.com/git-lfs/git-lfs/v3!g'
2021-09-02 20:41:08 +00:00
Chris Darroch
dd8e306e31 all: update go.mod module path with explicit v2
When our go.mod file was introduced in commit
114e85c2002091eb415040923d872f8e4a4bc636 in PR #3208, the module
path chosen did not include a trailing /v2 component.  However,
the Go modules specification now advises that module paths must
have a "major version suffix" which matches the release version.

We therefore add a /v2 suffix to our module path and all its
instances in import paths.

See also https://golang.org/ref/mod#major-version-suffixes for
details regarding the Go module system's major version suffix rule.
2021-08-09 23:18:38 -07:00
brian m. carlson
f32f3b2e9a
Tidy files
Tidy several untidy files with goimports.
2019-10-02 19:17:28 +00:00
Seamus Connor
83d7f76e76 Use git-ls-files to enumerate repo contents
Due to the complexities of handling .gitignores, rely directly on
git-ls-files rather than a custom gitignore-aware directory walking
routine.

As a side-effect, there has been a minor behaviorial change related to
locking. Previously, if a file was locked, then a matching pattern was
added to a .gitignore, that file was no longer considered locked and the
writeable attribute was set on that file. With this change, files which
match a .gitignore, but have been addded to the repository,
will still have their write bit cleared.

Fixes #3797
2019-09-17 17:41:00 -07:00