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'
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.
When a merge conflict occurs, it obviously isn't possible to check out
the file using git lfs checkout or git lfs pull, since it's unclear
which revision the user wants. git lfs checkout handles this gracefully
by just ignoring the conflict, whereas git lfs pull causes a full logged
error, which is excessive.
Let's make git lfs pull match the behavior of git lfs checkout here by
having it ignore malformed pointer files just like it ignores files that
are not pointers.
When there's a conflict with a file in Git LFS, it's difficult to get
the LFS contents of the conflicted files so that they can be run through
an appropriate diff tool. To make this easier, teach git lfs checkout
the --base, --theirs, and --ours flags to check out the base, theirs,
and ours outputs to a given path (specified with --to).
Be sure not to print a deprecation message in this case, since this is
not a deprecated use.
Note that we use three different variables for the base, theirs, and
ours flags because Cobra doesn't offer a command mode option that can
parse all of the flags into one variable.
The gitIndexer starts a new `git update-index` process when the first
file is given to it. A reference to this process is stored in the `cmd`
variable of the gitIndexer struct. This variable was always `nil` after
the refactoring in ae4d2611 ("move `git update-index` invocation to git
package", 2017-08-02). Consequently, a new `git update-index` process
was invoked for every file.
Fix this by refactoring the `git update-index` invocation, again. This
time we return the subprocess pointer. This is necessary because we
want to call `Wait()` on the process when the gitIndexer is closed.