Skip to content

Proposal: git lfs fetch/pull/checkout to call git equivalents? #1059

Closed

Description

@sinbad

Discussed as a follow-on from git lfs clone #844 (comment)

Proposal:

  1. Make git lfs pull, git lfs fetch, git lfs checkout perform the equivalent git commands first by default & pass args. git checkout probably doesn't need to do anything in most cases but if the file has been deleted this will make sure it gets restored AND converted to real lfs content which is better
  2. Add --only-lfs option to all 3 commands to bypass git part (backward compatibility & internal use)
  3. Require paths in git lfs checkout to be after -- as with git checkout
  4. Suppress filters during git lfs checkout and git lfs pull to gain same optimisations as git lfs clone

The advantages of doing this are:

  • Consistency; commands that sound like git commands always perform the git equivalent as well first & support the same options
  • Performance; git lfs clone improved clone performance by at least 50x, but large pulls or branch switches still have the serial smudge performance issue, which this will avoid

Disadvantages:

  • Behaviour changes to the commands affected, although not unintuitive ones
  • Breaking change to git lfs checkout interface (will now need -- before paths)

Activity

  1. larsxschneider commented on Mar 3, 2016

    @larsxschneider
    Member

    Sounds sensible to me. I would probably add a git-lfs config value to make --only-lfs the default behavior again (for backwards compatibility).

    That being said, I wonder if we should rather tackle the root of the problem as mentioned by @peff : #931 (comment)
    That is making Git filters process files as batches. I volunteered as Google Summer of Code mentor and I wonder if this might be an interesting project for a student?!

  2. sinbad commented on Mar 3, 2016

    @sinbad
    ContributorAuthor

    I'm not keen on a sticky config value because they tend to get forgotten and cause hidden issues & support cases; I'd rather it be explicit on each command. We're breaking it anyway, so the action for those wanting the old behaviour might as well be to change the args rather than setting a config value for scripts, and for interactive use the new default is likely to be useful anyway.

    As for git calling filters in batch, that would be great but I don't think we should necessarily rely on that getting accepted, plus supporting older git versions is nice.

  3. technoweenie commented on Mar 3, 2016

    @technoweenie
    Contributor

    I'm not sure we'll need a sticky config. I'm not opposed to adding one. I just added this to the v1.2 TODO list (#844):

    add all lfs.* git config keys to git lfs env output

  4. ttaylorr commented on Apr 16, 2018

    @ttaylorr
    Contributor

    I originally closed this because I hadn't looked at the time frame of this issue carefully enough, and thought that this was a proposal to add commands such as git lfs {push,pull,etc}, which have existed for a long time.

    It appears, however, that this issue seeks to change their behavior to call the underling Git operations as well. I think that this is a sizeable project, and think that we should avoid committing work to it since the current behavior works well for most users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions