back to eggert home
back to home
assign 4
man this assignment is all over the place, i'm like 90% sure eggert wrote this on acid
i'll try to include SO links that might be helpful wherever i can
this one also has a lot of things that could be dependent on the quarter you take him,
so i'll suffix all of those with a (QD) for "quarter-dependent"
alot of questions also want you to explain what you did to get the answer in `notes.txt`, so i'll
suffix those with (N)
basic diffing
that narcissist eggert wants us to work on his lil tzdb repo...
so clone that baby with this:
```bash
git clone https://github.com/eggert/tz
```
and let's get to work!
-
oops i lied about using git, first he wants you to do some stuff on github
go to the tzdb url and
diff the current commit with the second most recent commit
once you're at the diff page, just ctrl+s that baby and save it as `prevcur.html`
you might notice that when you view the html file you saved it looks awful, but that's to be expected!
also, don't worry if eggert commits some stuff during the assignment, thus changing the definition of
"most recent commit", as idt the TAs care too much anyways (N)
-
now use github to
compare the releases
2023d
and 2024a (QD)
and save that baby in a file named `2023d-2024a.html` (QD, N)
-
ok now we actually get to work on that local copy of the repo
make a bash/python script named `justone` that
outputs the difference
between the previous and current commit when run in a git repo (N)
if written in bash, this script should be really straightforward with just one line of code
-
once you have that script, run `justone` in that tz repo and put the output in a file
named `justone.out` like so:
```bash
./justone >justone.out
```
-
ok now write a script `compare-releases` that
compares two releases
given as arguments to the bash script (N)
like `justone`, this should be really simply, one line of bash
-
yeah basically do the same thing you did w/ `justone`: run it in the tz repo and put the output in a file
```bash
./compare-releases 2023d 2024a >2023d-2024a.diff # QD
```
why `.diff` for this and `.out` for the other? hell if i know.
general crap
-
alright so this next script, `tzcount` needs a bit more effort
it should take any commit range `git log` takes and calculate
the number of commits from each time zone in that range (N)
the output might look something like this:
```
-0800 12
-0400 1
-0300 3
+0200 10
```
notice how the time zones are sorted in numerical order
you can get an idea of how to get the time zone by checking out
this part of the `git log` docs
i also found this informative link
-
why the hell do the TAs need your cmd output why can't they just run it themselves:
```bash
./tzcount 2012j..2024a >tzdb-2012j-2024a.tzcount # QD
```
-
find the commit with this substring:
Even newspaper reports present contradictory information.
in a text file `who-contributed.txt`, put the commands you used and the following to be safe:
- commit hash
- date of the commit
- author of the commit
- anything other you think is notable about the commit (perhaps regarding the author?)
alright quick thing- after all these exercises he wants us to change to
git's own source code
-
ok have this commit hash
```
c03bee6e9f5c05259f5f501e1f47cd8adb63af38 (QD)
```
now draw the directed graph of all paths towards this commit from the earlier commit in `git-graph.pdf`
```
2a7d63a2453e2c30353342a2c9385fa22a846987 (QD)
```
each node in the graph should have the commit hash, author, and committer
they say only include committer if different but i got docked for not including that 💀
oh yeah, the arrows should point from the child to the parent
(usually the earlier and later commit respectively)
hey, did you know that `git log` has a
`--graph` option?
-
ok so in the git git repo, run `git branch` rq
ok now do the same for the git repo located on the seasnet server at `~eggert/src/github/git`
any differences? log them in `git.txt`
who the hell fixed this?
ok so the
git 2.39 release notes
say that an issue that could cause segfaults was fixed, which is pretty cool
now, eggert wants you to find the commit that actually fixed this
in a file named `git-detective.txt`, put the following:
- how you got the answer
- the title, author, and hash of the commit
- the file the commit touched that fixed the issue
- how did this commit fix the issue?
also, gen the patch file for the commit, and
document how you did so in `git-detective.txt` too
oh yeah submit the patch file too
hopefully helpful hints
- ok so this bug got fixed in 2.39, which means it was probably present in some other version...
-
try looking for keywords like "segfault" or "merge"
the cool thing about this repo is that the commit messages are actually descriptive and talk about
what their respective commits actually do/fix
what to turn in
the og spec actually outlines this pretty well, but i'll put it here jic
- `notes.txt`
- `prevcur.html`
- `2023d-2024a.html` (QD)
- `justone`
- `justone.out`
- `compare-releases`
- `2023d-2024a.diff` (QD)
- `tzcount`
- `tzdb-2012j-2024a.tzcount` (QD)
- `who-contributed.txt`
- `git.txt`
- `git-graph.pdf`
- `git-detective.txt`
- the patch file you generated w/ `git format-patch`; mine went smth like `0001-commit-name.patch`