The sound distributed version control system

#544 [BUG] pijul git creates .ignore and then fails on Uncommitted file

Opened by AfoHT on September 22, 2021
AfoHT on September 22, 2021

Tested on latest pijul 1.0.0-alpha.54

How to reproduce:

/tmp
❯ git init pijultest
Initialized empty Git repository in /tmp/pijultest/.git/

/tmp
❯ cd pijultest/

pijultest on  master
❯ git status
On branch master

No commits yet

nothing to commit (create/copy files and use "git add" to track)

pijultest on  master
❯ pijul git
Uncommitted file: ".ignore"
Error: There were uncommitted files

pijultest on  master [?]
❯ git status
On branch master

No commits yet

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	.ignore
	.pijul/

nothing added to commit but untracked files present (use "git add" to track)

pijultest on  master [?]
❯ git add .ignore

pijultest on  master [+?]
❯ git commit -m "Pijul ignore"
[master (root-commit) 426ad19] Pijul ignore
 1 file changed, 2 insertions(+)
 create mode 100644 .ignore

pijultest on  master [?]
❯ pijul git
INFO Loading Git history…
INFO Importing commit 426ad1906b6043f472a608999551220bf5cf1710: Pijul ignore
AfoHT added a change on September 22, 2021
This change could not be retrieved at the moment
VAG4AZT2W7U4NX3LOC64OPFL46ZNZ6AHHCETZBRUKBFW2UOH2F3AC
pmeunier on September 22, 2021

Thanks for the change! Any reason you’re using starts_with instead of just an equality test?

AfoHT on September 22, 2021

Good point, since the path/name is complete it could as well be tested for that way.

With the latest changes on main I also noted the method save_change() changed, which I also fixed. Not sure if that should go into a separate change?

Testing:

❯ ./testpijul.sh
Reinitialized existing Git repository in /tmp/pijultest/.git/
[master (root-commit) 83d4bf5] test
 1 file changed, 1 insertion(+)
 create mode 100644 test
INFO Loading Git history…
INFO Importing commit 83d4bf58883c60a2a5c708eef899c71ce4b0b401: test


/tmp
❯ cat testpijul.sh
#!/bin/bash

git init pijultest
cd pijultest
echo test > test
git add test
git commit -m "test"
pijul git
AfoHT added a change on September 22, 2021
Ignore .ignore on git import, update usage of save_change by 84ckh7VGFxTYiUZC9qStECzfDuDMziqP3MeVDWgCGxBR,
WHQCPTZHR5HLSCMRT74HR3T6N7NRTBCLTIMZ3EQAXMREGISWGHWQC
AfoHT on September 22, 2021

Oops, no need to keep that first change around, I noticed that became a dependency.

Lots to learn :D

AfoHT added a change on September 22, 2021
Ignore .ignore on git import, update usage of save_change by 84ckh7VGFxTYiUZC9qStECzfDuDMziqP3MeVDWgCGxBR,
B6WOR5U2XSAGWUI74IQH5VXOAZ73VSH5GI7LYWUB76NKK5VQFM2QC
AfoHT added a change on October 9, 2021
Ignore .ignore on git import by 84ckh7VGFxTYiUZC9qStECzfDuDMziqP3MeVDWgCGxBR,
S5VOOIB7MPLZWTL7TQVD6Y7H34WZ7R64TGC4FUYWDMXJYKVTN7MQC