kevin-hanselman/dud

commit does not work properly in certain situation: 'expected regular file'

thorstenwagner opened this issue · 1 comments

Hi,

assume you have a file A.txt in your repo and you want to update it.

First of all let me explain what works:

  1. delete A.txt
  2. replace it with the new A.txt
  3. dud commit; dud push etc

Now let me tell you when it fails:

  1. Delete A.txt
  2. Create the new file A.txt with a jupyter-notebook
  3. dud commit throws an error during commit command
.ipynb_checkpoints/coords_to_gt_2-checkpoint.ipynb: expected regular file, got link

Howeever, it created a link for A.txt
4. rm -rf .ipynb_checkpoints (because that shouldnt be commited and is unwanted)
5. dud commit now also throws errors for A.txt

A.txt: expected regular file, got link

Bug? :-)

Hi @thorstenwagner! Yes, this is a bug. I'm fairly sure the issue is that A.txt gets committed (and replaced with a link), but the commit fails due to something related to your .ipynb_checkpoints directory, so the stage file isn't written. When you attempt the second commit, Dud doesn't know that A.txt has been committed, sees it's a link, and complains.

Without a reproducible example, I can't be sure why the first commit is failing (on the .ipynb_checkpoints directory). If you can create a minimally reproducible example, that would be a big help.

The easiest way to start solving this issue would be to save the partially committed stage file when a failure occurs. I'll start looking into this.

This also brings up another issue that probably should be addressed sooner rather than later: adding a .dudignore file (#23)