Skip to content

Add hash-object to validate ruby hash function - #1081

Merged
ben merged 2 commits into
progit:masterfrom
jingsam:patch-1
Jun 14, 2018
Merged

Add hash-object to validate ruby hash function#1081
ben merged 2 commits into
progit:masterfrom
jingsam:patch-1

Conversation

@jingsam

@jingsam jingsam commented Jun 11, 2018

Copy link
Copy Markdown
Contributor

close #1080

@ben ben left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Just a couple of notes.

=> "bd9dbf5aae1a3862dd1526723246b20206e5fc37"
----

Let's validate the hash with `git hash-object`. It shows that they are identical. Note that `echo` will add a trailing newline character in string, which is not we want in this case. `echo -n` can prevent from adding a trailing newline character.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you reformat this so that each sentence is on its own line? It makes future PRs much easier to review.

Also, let's make it a bit more succinct. Something like this maybe?

Let's compare that to the output of `git hash-object`.
Here we use `echo -n` to prevent adding a newline to the input.

What do you think?

----
>> $ echo -n "what is up, doc?" | git hash-object --stdin
=> bd9dbf5aae1a3862dd1526723246b20206e5fc37
----

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you've got a shell sample marked up like it was typed into irb, which won't work. Could you remove the >> and => prefixes?

@jingsam

jingsam commented Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

ping @ben

@ben
ben merged commit 7836cfe into progit:master Jun 14, 2018
@ben

ben commented Jun 14, 2018

Copy link
Copy Markdown
Member

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

Successfully merging this pull request may close these issues.

hash-object is different from ruby's implemention

2 participants