The sound distributed version control system

#670 Pijul git fails to add files in directories.

Closed on May 5, 2022
spacefrogg on April 15, 2022

I imported a rather small git repository with pijul git. The first commit in the repository adds some files at the root and one directory containing one other directory and some files. Alphabetically, the directory is the last item in the tree, all files at the root come before it.

Pijul git misses it and records it as a binary file or an empty directory, I’m not sure. This is the part of the change:

12. File addition: "redoconf" in "" +dx "binary"
  up 0.2, new 24376:24395

The change ends here, and none of the files inside it (and the one directory) get added to the change.

Files that are changed in later git commits get added in full (in the wrong, later changes). Files that were added in this first git commit and were never changed are missed by pijul git and end up untracked.

Pijul git did not seem to have made any errors in later commits (apart from whole files added in later commits as a consequence of missing them earlier), just the first one.

pmeunier added a change on April 16, 2022
S7MPXAPHFSUUUUDEDGGUHOJXMEPYCWKYEVK4FVWQLRJLXGBQ4MRQC
main
spacefrogg on April 18, 2022

From zulip

I wanted to import a rather small repository (90 commits) to pijul and it got messed up. This is the shell script to reproduce an MWE:

rm -rf gittest
git init gittest
cd gittest
mkdir vdir wdir
echo file >vdir/file
echo file >wdir/file
git add .
git commit -m 'Initial commit'
pijul git
pijul diff -u

In a working version, the output of pijul diff -u should be only .ignore, but it also contains vdir/file and wdir/file.

Observations
  • pijul misses file which is inside vdir or wdir but only adds the directories
  • it does not “crash” at the first directory, though, but adds the second directory, as well, which also stays empty.
  • pijul git does not create a separate root change like a normal pijul record in an empty repository would do. Though, the first change contains a “Root add” hunk as its first hunk.
  • altering vdir/file in a later commit leads to a complete addition of the file as if it was new. This, obviously, changes the content and meaning of that change but “fixes” pijul’s file tracking.
Workaround

Add a commit before all the others which only adds files but no directories. Afterwards, commits adding files and directories are imported as expected.

pmeunier added a change on May 5, 2022
AEYADELNIHC7PUVJZRTUID5O6XLTORYKBGU4ZAIHVU5JY2KZQMNAC
main
pmeunier added a change on May 5, 2022
XFYALEYNPVBGT6ET2LT2QKBM4C5MFTIQKABOU3VQJLAYEWMJM22QC
main
pmeunier on May 5, 2022

Thanks for the report and for the very helpful MWE. This is fixed (at least I think).

pmeunier closed this discussion on May 5, 2022