Hi,
let say I have a first version of recorded file (line numbers are not in the file and are added for convenience):
1 a
2 b
3 c
4 d
5 e
6 f
7 g
and I’m adding some new features (A & F) alongside with some DEBUG code and now my file looks like:
1 a
2 A
3 b
4 c
5 d
6 DEBUG
7 e
8 f
9 F
10 g
now I want to record only new features (A & F without DEBUG) and according to https://pijul.org/manual/workflows/splitting_and_combining_changes.html :
You can remove any of these enumerated sections. This will leave the diff out of the recorded change, but your working copy will not be touched. This way, you can split up a big chunk of changes into several small ones or - if there were changes you didn’t want to keep in your repo -
pijul reset
whatever is left.
so I execute pijul record
and in my editor I see (Please pay attention that after filename there is a colon and line number) :
message = ''
timestamp = '2023-07-29T09:22:25.056582776Z'
authors = []
# Dependencies
[2] 4JLCVU6JJONBDALZCNZMFBHHDT5OSTQA35BV35DLWLJFU43OIAYQC # .
# Hunks
1. Edit in "file.txt":2 2.1 "UTF-8"
up 2.4, new 1:3, down 2.4
+ A
2. Edit in "file.txt":6 2.1 "UTF-8"
up 2.10, new 4:10, down 2.10
+ DEBUG
3. Edit in "file.txt":9 2.1 "UTF-8"
up 2.14, new 11:13, down 2.14
+ F
now I remove completely hunk number 2 which contains some debug code which I don’t want to record and just leave hunks 1 and 3 so I record:
message = 'Adding features A & F'
timestamp = '2023-07-29T09:26:35.871773415Z'
[[authors]]
key = 'AWLFuq7WFDrZBsBfQZCXRB9x6DoqDUdsPn8UsyUp36dF'
# Dependencies
[2] 4JLCVU6JJONBDALZCNZMFBHHDT5OSTQA35BV35DLWLJFU43OIAYQC # .
# Hunks
1. Edit in "file.txt":2 2.1 "UTF-8"
up 2.4, new 1:3, down 2.4
+ A
3. Edit in "file.txt":9 2.1 "UTF-8"
up 2.14, new 11:13, down 2.14
+ F
Pijul successfully records new features A & F (without DEBUG). However later when I check history with pijul change
command on this new version I still see
- Edit in “file.txt”:9 2.1 “UTF-8”
which points to wrong line number 9 because if I don’t record DEBUG change the relevant change is on line 8 and not on line 9.
Therefore my questions is this a bug or pijul internally stores some irrelevant information about line numbers? Or should I somehow always manually recalculate line numbers when I decide to record only partial changes in one file?