Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve episode 5 "Exploring History" #703

Open
rrahn opened this issue Dec 2, 2019 · 1 comment
Open

Improve episode 5 "Exploring History" #703

rrahn opened this issue Dec 2, 2019 · 1 comment

Comments

@rrahn
Copy link

@rrahn rrahn commented Dec 2, 2019

Hi, first of all thanks for the software carpentry git lesson. I think it is already great and I only have a minor remark/improvement. In the chapter https://swcarpentry.github.io/git-novice/05-history/index.html there is the part where a diff is done not against a relative commit from HEAD but using a commit ID. It further states that the 40 digit hash is hard to type and it would be sufficient to use the first 7 characters.

In general, I feel that the sentence should not start with "That's the right answer, ...", since there was never a question before. Further, I think at this point it would be helpful to revisit the git log --oneline feature, which was named in the lesson before as an additional feature to reduce the log information. But in addition, it shows the short IDs.

So my suggestion would be:

Great, now we see how the very first version of mars.txt differs from the current one (the HEAD). But typing out random 40-character strings is annoying, so Git lets us use just the first few characters (typically seven for normal size projects). To quickly get the short ID we can also use the command git log --oneline and copy the ID from the respective commit.

Please, let me know if this is helpful or should be further revised. I am happy to make a PR for this as well.

Many thanks.

@kekoziar
Copy link
Contributor

@kekoziar kekoziar commented Jul 27, 2021

Hello, @rrahn. Thank you for your comments. I'm fairly certain that the sentence, "That's the right answer" is more of a "Thankfully, that's the right answer" and in relation to having correctly typed out the 40-character string. Remember, the changes were already shown and described when the command git diff HEAD~3 mars.txt was run, so the first sentence in your suggestion repeats that. This section focuses on showing different ways of exploring history.

Also in terms of your rewrite, not all systems allow users to copy/paste from the command-line, so using the git log --oneline to "copy the ID" doesn't help everyone. Perhaps what can be added is an additional sentence after "(typically seven for normal size projects)"

The command git log --oneline also shows shortened identifiers.

As an aside: stemming from learner questions in some workshops, we've had fun during this section by testing to see how short of an ID will work, while explaining that all Git is looking for is a unique identifier, so you can use the shortest unique identifier to refer to any particular commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants