Skip to content

Instantly share code, notes, and snippets.

@floer32
Last active May 25, 2022 17:41

Revisions

  1. floer32 revised this gist May 25, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git ribbon, git catchup.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    I've used these for years ([found here](https://gitready.com/advanced/2011/10/21/ribbon-and-catchup-reading-new-commits.html))

    * `git ribbon` to mark latest main you've reviewed (like a ribbon in a journal)
    * `git catchup` to review diff since then. (then git ribbon after reviewing, so it's ready for tomorrow.)
    * `git catchup` to review diff since then. (then do `git ribbon` again after reviewing, so it's ready for tomorrow.)

    In your `~/.gitconfig`, `[aliases]` section:

  2. floer32 revised this gist May 23, 2022. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions git ribbon, git catchup.md
    Original file line number Diff line number Diff line change
    @@ -14,10 +14,6 @@ ribbon = tag --force _ribbon origin/main
    catchup = log --patch --reverse --topo-order _ribbon..origin/main
    ```

    🟢 The flags include `--reverse --topo-order` so it'll show in order from oldest to newest (much easier to review that way).

    🟣 The last part (`':(exclude)build/*' ':(exclude)../build/*'`) is optional, just helps in a repo I keep up with where they commit the latest release's build artifacts in a directory called `build` at the repository root. I'm usually invoking this command from one level down, hence the `../` part.

    ### [2/2] Set git diff viewer to `delta`

    This works best with [`delta`](https://github.com/dandavison/delta), a really good diff viewer with syntax highlighting:
  3. floer32 revised this gist May 23, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion git ribbon, git catchup.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ In your `~/.gitconfig`, `[aliases]` section:

    ```
    ribbon = tag --force _ribbon origin/main
    catchup = log --patch --reverse --topo-order _ribbon..origin/main ':(exclude)build/*' ':(exclude)../build/*'
    catchup = log --patch --reverse --topo-order _ribbon..origin/main
    ```

    🟢 The flags include `--reverse --topo-order` so it'll show in order from oldest to newest (much easier to review that way).
  4. floer32 created this gist May 18, 2022.
    27 changes: 27 additions & 0 deletions git ribbon, git catchup.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    ## How I keep up with changes on `main`

    ### [1/2] These two git aliases: `git ribbon`, `git catchup`

    I've used these for years ([found here](https://gitready.com/advanced/2011/10/21/ribbon-and-catchup-reading-new-commits.html))

    * `git ribbon` to mark latest main you've reviewed (like a ribbon in a journal)
    * `git catchup` to review diff since then. (then git ribbon after reviewing, so it's ready for tomorrow.)

    In your `~/.gitconfig`, `[aliases]` section:

    ```
    ribbon = tag --force _ribbon origin/main
    catchup = log --patch --reverse --topo-order _ribbon..origin/main ':(exclude)build/*' ':(exclude)../build/*'
    ```

    🟢 The flags include `--reverse --topo-order` so it'll show in order from oldest to newest (much easier to review that way).

    🟣 The last part (`':(exclude)build/*' ':(exclude)../build/*'`) is optional, just helps in a repo I keep up with where they commit the latest release's build artifacts in a directory called `build` at the repository root. I'm usually invoking this command from one level down, hence the `../` part.

    ### [2/2] Set git diff viewer to `delta`

    This works best with [`delta`](https://github.com/dandavison/delta), a really good diff viewer with syntax highlighting:

    https://github.com/dandavison/delta

    (You just do `brew install git-delta` (or equivalent for another package manager, it's widely available), then a couple changes to `~/.gitconfig` as shown in [its README](https://github.com/dandavison/delta), to configure it as the default diff viewer.)