o
/|\ 
/ \
_________________________________________
|                                       |
|  sleepygeek.org                       |
|   - Linux kernel gift wrapping paper  |
|_______________________________________|
                   | | 
                   | | 
                   | | 
|0       |10       |20       |30       |40       |50       |60       |70     80|
|                                                                              |
\-------[ projects ]----------------[ photos ]---------------[ contact ]-------/


Gift wrapping paper covered in changes made to the Linux kernel on December
25th for the last few years.

* 27 pages
* Covers years 2005 - 2010
* Commit dates in bold
* Unified diff

Grab the PDF here:

christmascommits-2005-2010.pdf (344KB)

Read on for how to do it yourself:

 = 1) Get a copy of the Linux kernel source in a git repository
-----------------------

$ cd /tmp
$ git clone --bare \
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Initialized empty Git repository in /tmp/linux-2.6.git/
remote: Counting objects: 1810706, done.
remote: Compressing objects: 100% (278588/278588), done.
remote: Total 1810706 (delta 1516272), reused 1810658 (delta 1516226)
Receiving objects: 100% (1810706/1810706), 357.99 MiB | 1885 KiB/s, done.
Resolving deltas: 100% (1516272/1516272), done.
$ cd linux-2.6.git
$

 = 2) Find the year of the earliest commit
-----------------------

We do this to figure out how many December 25ths there are between now and then.

$ # Count all the commits.
$ git rev-list --all | wc -l
223502
$
$ # Show the log for commits, skipping all but one of them.
$ git log --skip=223501
commit 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Author: Linus Torvalds 
Date:   Sat Apr 16 15:20:36 2005 -0700

    Linux-2.6.12-rc2
    
    Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.
    
    Let it rip!

There we go, looks like Linus started using git for the kernel in 2005!

 = 3) Pull out all the commits on any December 25th
-----------------------

For every year between the beginning and now, get a list of commits that
took place on December 25th. Make sure to show the 'fuller' format, which
has the actual date it was committed, rather than the date the author wants
to record with the commit.

Use -U to show a unified diff, so we can see what changed, and put all the
output in a file.

$ for year in $(seq 2005 2010)
> do
>  git log --date=local --format=fuller -U --after="$year-12-25 00:00:00" \
>  --before="$year-12-25 23:59:59"
> done > christmas_linux_commits.txt
$
$ wc christmas_linux_commits.txt
 29176 111860 945801 christmas_linux_commits.txt
$

 = 4) Add some formatting, remove newlines, and create a postscript file
-----------------------

Wrap the 'CommitDate' lines in an escript escape code for changing the font
size and making it bold. Replace all newlines with commas, so all the text
runs together in a single huge block.

Use enscript to produce postscript from this text, using a small font, no 
header, using escape codes, no margins, and writing it to a file.

$ sed -e 's/\(CommitDate:.*\)/\x00font{Courier-Bold6}\1\x00font{default}/g' \
> christmas_linux_commits.txt |
> tr '\n' ',' |
> enscript -e -B -f Courier4 -pchristmascommits-2005-2010.ps --margins=0:0:0:0
[ 27 pages * 1 copy ] left in christmascommits-2005-2010.ps
1 line(s) were wrapped
3 non-printable characters
$

 = 5) Convert the postscript file to a PDF
-----------------------

Finally, convert the postscript file to a PDF for printing and distribution.

$ ps2pdf christmascommits-2005-2010.ps
$ 

That's it!

christmascommits-2005-2010.pdf (344KB)