Commit Graph

21 Commits

Author SHA1 Message Date
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
9e3bc45b93
pull: gracefully handle merge conflicts
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.
2020-10-22 20:56:31 +00:00
Marat Radchenko
482260c7e3 Fix error strings to follow Go guidelines
Error strings should not be capitalized (unless beginning with proper nouns or acronyms) or end with punctuation:
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
2019-10-22 17:33:49 +03:00
John Wass
dc3e8f450c do not log skipped checkouts to file 2019-07-26 11:30:18 -04:00
brian m. carlson
cf7f9678b3
commands: add flags to get conflicted contents
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.
2018-10-02 13:57:08 +00:00
rick olson
b3f0dacdc8 lfs: remove static lfs pointer clean/smudge funcs 2017-10-24 12:07:53 -06:00
rick olson
97fc2ed06b remove reliance on global config filesystem vars 2017-10-18 18:09:33 -06:00
risk danger olson
cc3afc8225 Merge branch 'master' into checkout-no-clean 2017-10-18 15:18:11 -07:00
rick olson
7158e3bb63 add files to index with path relative to current dir 2017-10-03 10:48:18 -06:00
risk danger olson
ea54e1ff3f remove unnecessary comments 2017-09-28 09:25:40 -06:00
rick olson
8e9fbf4e94 don't replace pointers with objects if clean filter is not configured 2017-09-27 17:11:42 -06:00
Lars Schneider
e176f361d6 fix multiple git update-index invocations
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.
2017-08-26 13:16:24 +02:00
Lars Schneider
ae4d26110b move git update-index invocation to git package
The only side effect of this refactoring should be that the Git LFS
is disabled for the Git subprocess. No other functional changes are
intended.
2017-08-22 19:34:29 +02:00
risk danger olson
fecdc9e745 commands: keep a global lfsapi.Client and tq.Manifest for a single lfs command 2017-01-04 16:10:30 -07:00
risk danger olson
2b20d510cc tq: remove remote/operation/access from tq.Manifest, make remote an arg of NewTransferQueue() 2017-01-04 14:46:30 -07:00
risk danger olson
29ab015945 commands: rely on cfg.CurrentRemote less 2017-01-04 10:36:09 -07:00
risk danger olson
7302143a01 commands: remove magical TransferManifest() in favor of explicit buildTransferManifest() 2017-01-04 10:36:09 -07:00
risk danger olson
e469ca0115 fix some merge conflicts 2016-12-16 10:35:38 -07:00
risk danger olson
b2e6de51c3 Move checkout() to *singleCheckout 2016-12-14 15:29:03 -07:00
risk danger olson
8adf6ec8f6 Encapsulate checking out a single file into *singleCheckout 2016-12-14 15:17:24 -07:00