Explicitly adding .pijul is now forbidden

[?]
Jan 12, 2021, 1:19 PM
3J6IK4W2BA4RJJQYXZOQFU4AQ3WJIM3TUXUNNBIQ6M6TS2JSHT6QC

Dependencies

  • [2] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [3] AFWNXPBK Prevent the addition of .pijul to the repository
  • [4] XTMYHJZL Changing the default filters for ignored files
  • [5] 4OCC6D42 Recursive add
  • [6] OJZWJUF2 MUCH faster `pijul add -r`
  • [7] 4VWXL6KQ Correct handling of ignore files
  • [8] ZHABNS3S Canonicalize all paths
  • [*] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).

Change contents

  • replacement in libpijul/src/working_copy/filesystem.rs at line 144
    [4.1972][4.1972:2017]()
    let meta = std::fs::metadata(&full);
    [4.1972]
    [4.2017]
    let meta = std::fs::metadata(&full)?;
  • replacement in libpijul/src/working_copy/filesystem.rs at line 149
    [4.1901][4.1901:1902]()
    [4.1901]
    [2.19680]
    if !filter_ignore(&repo_path.as_canonical_path(), &full.as_canonical_path(), meta.is_dir()) {
    return Ok(())
    }
  • replacement in libpijul/src/working_copy/filesystem.rs at line 153
    [2.19764][4.1063:1195](),[4.1063][4.1063:1195](),[4.1195][3.243:445](),[3.445][4.1291:2061](),[4.77][4.1291:2061](),[4.1291][4.1291:2061]()
    if let Ok(meta) = meta {
    if meta.is_dir() {
    let mut walk = WalkBuilder::new(&full);
    walk.ignore(true)
    .git_ignore(true)
    .filter_entry(|p| p.file_name() != crate::DOT_DIR)
    .threads(threads - 1);
    walk.build_parallel().run(|| {
    Box::new(|entry| {
    let entry: ignore::DirEntry = if let Ok(entry) = entry {
    entry
    } else {
    return ignore::WalkState::Quit;
    };
    let p = entry.path();
    if let Some(p) = p.file_name() {
    if let Some(p) = p.to_str() {
    if p.ends_with("~") || (p.starts_with("#") && p.ends_with("#"))
    {
    return ignore::WalkState::Skip;
    }
    [2.19764]
    [4.2061]
    if meta.is_dir() {
    let mut walk = WalkBuilder::new(&full);
    walk.ignore(true)
    .git_ignore(true)
    .filter_entry(|p| {
    debug!("p.file_name = {:?}", p.file_name());
    p.file_name() != crate::DOT_DIR
    })
    .threads(threads - 1);
    walk.build_parallel().run(|| {
    Box::new(|entry| {
    let entry: ignore::DirEntry = if let Ok(entry) = entry {
    entry
    } else {
    return ignore::WalkState::Quit;
    };
    let p = entry.path();
    if let Some(p) = p.file_name() {
    if let Some(p) = p.to_str() {
    if p.ends_with("~") || (p.starts_with("#") && p.ends_with("#"))
    {
    return ignore::WalkState::Skip;
  • replacement in libpijul/src/working_copy/filesystem.rs at line 177
    [4.2125][4.1903:2273](),[4.2273][4.1739:1941](),[4.1941][4.2361:2476](),[4.2361][4.2361:2476]()
    debug!("entry path = {:?} {:?}", entry.path(), repo_path);
    if let Ok(entry_path) = CanonicalPathBuf::canonicalize(entry.path()) {
    if let Ok(path) = entry_path.as_path().strip_prefix(&repo_path) {
    let is_dir = entry.file_type().unwrap().is_dir();
    if sender.send((path.to_path_buf(), is_dir)).is_err() {
    return ignore::WalkState::Quit;
    }
    } else {
    debug!("entry = {:?}", entry.path());
    [4.2125]
    [4.2476]
    }
    debug!("entry path = {:?} {:?}", entry.path(), repo_path);
    if let Ok(entry_path) = CanonicalPathBuf::canonicalize(entry.path()) {
    if let Ok(path) = entry_path.as_path().strip_prefix(&repo_path) {
    let is_dir = entry.file_type().unwrap().is_dir();
    if sender.send((path.to_path_buf(), is_dir)).is_err() {
    return ignore::WalkState::Quit;
  • edit in libpijul/src/working_copy/filesystem.rs at line 185
    [4.2510]
    [4.2677]
    } else {
    debug!("entry = {:?}", entry.path());
  • replacement in libpijul/src/working_copy/filesystem.rs at line 188
    [4.2707][4.2574:2657]()
    ignore::WalkState::Continue
    })
    [4.2707]
    [4.2657]
    }
    ignore::WalkState::Continue
  • replacement in libpijul/src/working_copy/filesystem.rs at line 191
    [4.2680][4.2511:2604](),[4.2604][4.2754:2825](),[4.2754][4.2754:2825](),[4.2825][4.3413:3431](),[4.3413][4.3413:3431]()
    } else if let Ok(path) = full.as_path().strip_prefix(&repo_path.as_path()) {
    sender.send((path.to_path_buf(), false)).unwrap();
    }
    [4.2680]
    [4.3721]
    })
    } else {
    debug!("filter_ignore ok");
    let path = full.as_path().strip_prefix(&repo_path.as_path()).unwrap();
    sender.send((path.to_path_buf(), false)).unwrap();