Skip to content

git lfs lockable without lfs tracking does not mark files as readonly #3555

Closed
@OneLineTwoBugs

Description

@OneLineTwoBugs

Hi,

as already mentioned in #2497, here as a new issue. This is using git-lfs 2.7.1 on Windows (bundled with git-for-windows 2.21.0 installer, 64bit)

To reproduce, I use a repo without a .gitattributes file, no LFS support so far, but some .hardToMerge files.

git clone http://.../repo.git
cd repo
echo "*.hardToMerge -text lockable" > .gitattributes
git add .gitattributes
git commit -m "make .hardToMerge lockable"

I expect that this commit should mark all .hardToMerge files as read-only, but it doesn't. In fact, I can push, pull and reclone as much as I want and the files are not marked as read-only. I assume this is the case because this repo never triggers LFS hooks, as it doesn't LFS track any files.

What does work however is executing git lfs lock bla.hardToMerge; git lfs unlock bla.hardToMerge. Now, the file is marked as read-only.

Sidenote: git lfs track "*.hardToMerge" --lockable; git add -A; git commit -m "lfs track hardToMerge" works as expected, but it also enables LFS tracking for *.hardToMerge, which I don't want in this case as the files are not very large (couple of MBs) and they stay very similar after changing them, so git's delta compression works very well on them. (they are MS Access DBs in my case). In fact, for my particular repo with a lot of history, using git lfs migrate import --everything --include="*.mdb" turns neat 800MB repository in a 12GB beast.

I guess the question is: Is using lockable in .gitattributes without ANY LFS tracking even a supported scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions