lakeFS icon indicating copy to clipboard operation
lakeFS copied to clipboard

[Bug]: `lakectl local commit` commits staged changes outside of its directory

Open arielshaqed opened this issue 10 months ago • 3 comments

What happened?

What actually happened, including error codes if applies.

Steps to Reproduce:

  1. Ensure lakefs://repo/main is dirty but has no "directory" path xyzzy.

  2. lakectl local init lakefs://repo/main/xyzzy

  3. touch x

  4. lakectl local commit --message 'add xyzzy for lulz'

  5. lakectl diff lakefs://repo/main{~,}:

    Left ref: lakefs://ariels-repo/main~
    Right ref: lakefs://ariels-repo/main
    + added .hidden-foo
    + added foofoo
    + added xyzzy/x
    

These 2 files were added by lakectl local because I added them elsewhere.

Expected behavior

lakectl commit should fail with an error about the branch being dirty, or lakectl should be more like Git LFS and not hide changes from me.

lakeFS version

No response

How lakeFS is installed

No response

Affected clients

No response

Relevant log output

No response

Contact details

No response

arielshaqed avatar Apr 18 '24 13:04 arielshaqed

Requires @treeverse/product specification

N-o-Z avatar May 13 '24 08:05 N-o-Z

Expected behavior

  • Fail the commit
  • Print an error message:
error: The branch you are trying to commit to contains uncommitted changes outside the lakeFS path your local directory '<DIR_NAME>' is synced with.
To proceed, use the --force option.
  • add a --force -f flag lakectl local commit

FYI @N-o-Z

talSofer avatar May 15 '24 09:05 talSofer

@eladlachmi @arielshaqed @talSofer making sure we understand the implications of this since it is a breaking change.

N-o-Z avatar May 22 '24 07:05 N-o-Z