Add a Pijul demo that show reordering patches behaviour

[?]
Oct 1, 2021, 8:57 AM
F3AD6JXXPNTLIUXPX7CUPZCD53SLZFKCSSNVQDW6Q32BUIT2RNWAC

Dependencies

Change contents

  • replacement in sections/5-fossil.md at line 106
    [4.630][4.630:652]()
    touch Sample.java
    [4.630]
    [4.671]
    vi Sample.java
    public class Sample {}
  • replacement in sections/5-fossil.md at line 119
    [4.56884][4.56884:56911]()
    public class Sample {}
    [4.56883]
    [4.56912]
    vi Sample.java
    // roll the die on stage!!
    public static void main(String... args) {
    System.out.println(random());
    }
    private static int random() {
    // Chosen by fair dice roll; guaranteed to be random.
    return 4;
    }
  • edit in sections/6-pijul.md at line 90
    [4.1468]
    [4.1561]
    * Reordering patches
  • edit in sections/6-pijul.md at line 101
    [2.326][2.326:435]()
    touch Sample.java
    pijul status
    pijul add Sample.java
    mkdir directory
    pijul add directory
  • edit in sections/6-pijul.md at line 102
    [2.452][2.452:469](),[2.469][4.1494:1495](),[4.6529][4.1494:1495](),[4.1494][4.1494:1495](),[4.1495][2.470:742](),[2.742][4.1759:1790](),[4.6806][4.1759:1790](),[4.1759][4.1759:1790]()
    pijul record
    (Here `y` means yes, `n` means no, `k` means undo and remake last decision, `a` means include this and all remaining patches, `d` means include neither this patch nor the remaining patches and `i` means ignore this file locally (i.e. it is added to .pijul/local/ignore).)
    ### Generating random numbers
  • replacement in sections/6-pijul.md at line 103
    [4.1791][2.743:777]()
    **!!! Roll the die on stage !!!**
    [4.1791]
    [4.1823]
    ### Recording patches
  • edit in sections/6-pijul.md at line 105
    [4.1824]
    [17.8619]
    vi Sample.java
  • replacement in sections/6-pijul.md at line 111
    [4.1992][4.1992:2080]()
    // Chosen by fair dice roll; guaranteed to be random.
    return 4;
    [4.1992]
    [4.2080]
    return java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 7);
  • edit in sections/6-pijul.md at line 113
    [4.2090][4.2090:2140](),[4.57051][4.2232:2266](),[4.2232][4.2232:2266](),[4.2266][4.57052:57106]()
    }
    pijul add Sample.java
    pijul record
    private static int random() {
    return 1 + new java.util.Random().nextInt(6);
  • edit in sections/6-pijul.md at line 114
    [4.57108][4.2314:2357](),[4.2314][4.2314:2357](),[4.57110][4.2453:2487](),[4.2453][4.2453:2487](),[4.2487][3.238:317](),[3.317][4.2537:2543](),[4.57169][4.2537:2543](),[4.2537][4.2537:2543](),[4.57171][4.2544:2570](),[4.2544][4.2544:2570](),[4.2570][4.2:19](),[4.20][4.20:88]()
    pijul add Sample.java
    pijul record
    private static int random() {
    return java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 7);
    }
    pijul add Sample.java
    pijul record
    pijul unrecord // unrecord all patches and squash them into one
  • edit in sections/6-pijul.md at line 115
    [3.344]
    [4.2570]
    mkdir directory
    pijul add directory
    pijul status
  • edit in sections/6-pijul.md at line 119
    [4.2587]
    [4.1592]
    (Here `y` means yes, `n` means no, `k` means undo and remake last decision, `a` means include this and all remaining patches, `d` means include neither this patch nor the remaining patches and `i` means ignore this file locally (i.e. it is added to .pijul/local/ignore).)
    ### Reordering patches
  • replacement in sections/6-pijul.md at line 124
    [4.4236710][4.4236710:4236767]()
    Zie `misc/MyRandom.java` voor als je de details vergeet.
    [4.1593]
    [4.2747]
    pijul init beers-and-movies
    cd beers-and-movies
    touch README.md
    pijul add README.md
    pijul record -m "Initial patch"
    pijul fork next-week
    pijul branches
    pijul checkout master
    vi movies.txt
    pijul record -m "Watched a movie"
    vi beers.txt
    pijul add beers.txt
    pijul record -m "Drank a beer"
    vi movies.txt
    pijul add movies.txt
    pijul record -m "Watched another movie"
    pijul log
    pijul checkout next-week
    pijul apply <hash> (beer)
    ls
    pijul apply <hash> (another movie)
    pijul apply <hash> (movie)
    pijul apply <hash> (another movie)