Lecture Notes

Learning assistant supported notes for CS 35L


Project maintained by UCLA-CS-35L Hosted on GitHub Pages — Theme by mattgraham

Version Control

What do we want out of version control?

Git (and other systems)

Getting Started with Git

From Scratch:

git init

From Existing Repository:

git clone [repository]

Git Components:

Git Commit Structure

Git Commit Naming

Git Internals

Why Learn Internals?

  1. Get intuition about what works
  2. Good practice for software construction

Plumbing vs Porcelain

Important Git Files & Directories

.git/config

.git/hooks/

.git/index

.git/info/exclude

.git/log

.git/objects

Storage Format

Git Object Types

Simplest Object Path:

Blob → Tree → Commit

Example:

echo 'Arma Virumque cano' | git hash-object --stdin
echo 'Arma Virumque cano' | git hash-object --stdin -w

Git Compression

Why?

Techniques

Huffman Coding

Dictionary Compression

Order of Compression:

  1. Dictionary compression first (detect patterns)
  2. Huffman encoding second (optimize bit width)

Git Bisecting and Debugging

Binary Search to Find Bug Introductions

git bisect start
git bisect bad HEAD
git bisect good v27.0

Walkthrough:

git checkout <some_commit>
make check
git bisect good
git bisect skip

Or automate:

git bisect start HEAD v27.0
git bisect run make check