<commit_before>---
layout: post
title: "ribbon/catchup: reading new commits"
category: advanced
---

I picked up this trick to use Git as a kind of feed-reader on "Moro's blog":http://d.hatena.ne.jp/moro/20110719/1311048331, so I thought I'd share it here:

Let's say you want to stay up-to-date with a project - for example, an upstream repository you are contributing to, a smart developer you are trying to learn from, or an awesome library you'd just like to watch. How do you go about following the commits that are being pushed?

You _could_ use RSS feeds, such as the ones offered by GitHub:

p=. !/images/github-feed.png!

But let's be honest: We would much rather read commits and diffs in the shell, like we are used to. (And as a bonus, we won't be assaulted by webcomics, pictures of kittens, and any number of other distractions our feed reader has in store for us.)

So instead, we display new commits with @git log@, and use Git's "lightweight tag system":http://book.git-scm.com/3_git_tag.html to place a "ribbon" marker tag that keeps track of how far we have read.

p=. !/images/ribbon-marker.jpg(A real-life ribbon marker)!:http://www.flickr.com/photos/beth19/4288525214/ <!-- photo CC BY-NC-ND 2.0 on Aug 20, 2011 -->

Simply add the following code to your @~/.gitconfig@:

<pre>
[alias]
    ribbon = tag --force _ribbon origin/master
    catchup = log --patch --reverse --topo-order _ribbon..origin/master
</pre>

Clone the project you want to watch, and type @git ribbon@ to initialize the ribbon marker.

Now whenever you fetch or pull, use @git catchup@ to read up on the latest changes in the @origin/master@ branch. After you are done reading, update the ribbon marker with @git ribbon@.

Sweet, isn't it?

By the way: If you do not like to read the individual commits in topic branches that were merged into @origin/master@, consider adding @--first-parent -m@ to the catchup log command.

p(((. <i>This is a guest post from "<NAME>":https://twitter.com/jo_liss. Jo likes JavaScript and created a "solitaire game":http://www.solitr.com/. </i><commit_msg>Grammar, how does it work<commit_after>---
layout: post
title: "ribbon/catchup: reading new commits"
category: advanced
---

I picked up this trick to use Git as a kind of feed-reader on "Moro's blog":http://d.hatena.ne.jp/moro/20110719/1311048331, so I thought I'd share it here:

Let's say you want to stay up-to-date with a project - for example, an upstream repository you are contributing to, a smart developer you are trying to learn from, or an awesome library you'd just like to watch. How do you go about following the commits that are being pushed?

You _could_ use RSS feeds, such as the ones offered by GitHub:

p=. !/images/github-feed.png!

But let's be honest: We would much rather read commits and diffs in the shell, like we are used to. (And as a bonus, we won't be assaulted by webcomics, pictures of kittens, and any number of other distractions our feed reader has in store for us.)

So instead, we display new commits with @git log@, and use Git's "lightweight tag system":http://book.git-scm.com/3_git_tag.html to place a "ribbon" marker tag that keeps track of how far we have read.

p=. !/images/ribbon-marker.jpg(A real-life ribbon marker)!:http://www.flickr.com/photos/beth19/4288525214/ <!-- photo CC BY-NC-ND 2.0 on Aug 20, 2011 -->

Simply add the following code to your @~/.gitconfig@:

<pre>
[alias]
    ribbon = tag --force _ribbon origin/master
    catchup = log --patch --reverse --topo-order _ribbon..origin/master
</pre>

Clone the project you want to watch, and type @git ribbon@ to initialize the ribbon marker.

Now whenever you fetch or pull, use @git catchup@ to read up on the latest changes in the @origin/master@ branch. After you are done reading, update the ribbon marker with @git ribbon@.

Sweet, isn't it?

By the way: If you do not like to read the individual commits in topic branches that were merged into @origin/master@, consider adding @--first-parent -m@ to the catchup log command.

p(((. <i>This is a guest post by "<NAME>":https://twitter.com/jo_liss. Jo likes JavaScript and created a "solitaire game":http://www.solitr.com/. </i>
{'fraction_non_alphanumeric': 0.09755512943432407, 'fraction_numerical': 0.018696069031639503, 'mean_word_length': 3.846689895470383, 'pattern_counts': {'":': 8, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2014220', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1234, 'n_words': 615}