Reimplementation of Pijul in C, for education, fun and absolutely no profit

#6 Support VERSION_NOENC (4) change author format

Closed on October 17, 2023
laumann on June 26, 2023

The current change format version is 6, but 4 is still present in a few places. Version 4 appears to be different primarily different in the encoding of author information. It’s still a list of authors, but the author type itself was expanded from a struct with three fixed fields to a dictionary that can hold arbitrary keys (usually just a single key entry).

A good small example in the pijul codebase is GLMOA3PFDR7HHJ3QMVZBNNJ3CGZAF72AZ5UBNEQON37K5WFNZP6QC:

pl change GLMOA3PFDR7HHJ3QMVZBNNJ3CGZAF72AZ5UBNEQON37K5WFNZP6QC
message = 'More edges in "credit"'
timestamp = '2020-11-23T18:02:01.600339622Z'

[[authors]]
full_name = 'Pierre-Étienne Meunier'
name = 'pmeunier'

# Dependencies
[2] NLGQAH4H35XC5XTH26BRXVFWGPPAMA4MDN3MHMGCOYE6ZZQMQ4AAC # Credit and reset relative to current directory instead of the root
[3]+SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC # Fixing the bad changes in history (unfortunately, by rebooting).
[*] SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC # Fixing the bad changes in history (unfortunately, by rebooting).

# Hunks

1. Replacement in "pijul/src/commands/credit.rs":99 3.178684 "UTF-8"
B:BD 3.181558 -> 2.334:427/2
  up 3.181558, new 0:56, down 3.181558
-                 .filter(|e| e.flag.contains(EdgeFlags::BLOCK) && !e.introduced_by.is_root())
+                 .filter(|e| !e.introduced_by.is_root())

Note the full_name and name fields under author.

laumann on June 26, 2023

The format is defined in libpijul/src/change/noenc.rs, specifically:

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Default)]
pub struct Author {
    pub name: String,
    #[serde(default)]
    pub full_name: Option<String>,
    #[serde(default)]
    pub email: Option<String>,
}
laumann added a change on October 5, 2023
R4SKL65GETMZDUYNYY6CV22EPUAFKDA3WGRZGCISHLVETCD6WK4AC
laumann added a change on October 6, 2023
JKKBLMQQHRGQVLTKTY2GUG2MLRICUM6B7TPUUSEPN4EGQYOCX4HAC
laumann added a change on October 6, 2023
WBRPDT27LZ3IV2YPYEBGBH7H7FJO2BRP6QHQHV4YNY2HH5FCGVCAC
laumann added a change on October 6, 2023
ZS3UJEZU4PZEYOXQNZWZGDNXTP5ESNPRAEHPJQ24O3TWZH746IBQC
main
laumann on October 17, 2023

This is done.

laumann closed this discussion on October 17, 2023