41 lines
949 B
Markdown
41 lines
949 B
Markdown
---
|
|
type: challenge
|
|
title: "The Historian"
|
|
xp: 75
|
|
duration: 25
|
|
difficulty: 3
|
|
---
|
|
|
|
# The Historian
|
|
|
|
> **[INCOMING — Mission Control, Earth]**
|
|
>
|
|
> Cadet, the repo in your working directory contains five commits
|
|
> from a previous mission. We need a historian's eye on it.
|
|
>
|
|
> Two commands today:
|
|
>
|
|
> - `git log --oneline` — compact one-line-per-commit history
|
|
> - `git show <hash>` — show what a commit changed
|
|
>
|
|
> Your script must produce two files:
|
|
>
|
|
> 1. `log.txt` — full one-line log
|
|
> 2. `breach-commit.txt` — short hash of the commit whose message
|
|
> mentions `BREACH`
|
|
>
|
|
> Hint: pipe the log through `grep BREACH | awk '{print $1}'` to
|
|
> extract the short hash from the matching line.
|
|
>
|
|
> [END TRANSMISSION]
|
|
|
|
## Your Task
|
|
|
|
In `starter/starter.sh`, capture the full log and the breach commit's
|
|
short hash.
|
|
|
|
## Objectives
|
|
|
|
- `log.txt` lists all 5 commits, one per line
|
|
- `breach-commit.txt` contains the short hash of the BREACH commit
|