Skip to content

Conversation

Rafi993
Copy link
Contributor

@Rafi993 Rafi993 commented Mar 4, 2018

usage of git cat-file -p master^{tree} command in other environments as specified in this answer https://stackoverflow.com/a/17121954/2445295 thanks to @Mellbourn

usage of git cat-file -p master^{tree} command in other shells as specified in this answer https://stackoverflow.com/a/17121954/2445295 thanks to @Mellbourn
The `master^{tree}` syntax specifies the tree object that is pointed to by the last commit on your `master` branch.
Notice that the `lib` subdirectory isn't a blob but a pointer to another tree:

**NOTE**: while using `master^{tree}` syntax if you have error try the following
Copy link
Member

Choose a reason for hiding this comment

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

Instead of just setting this in bold-face, let's use the Asciidoc "note" feature:

[NOTE]
====
(Note content goes here)
====

This will render much nicer.

In addition, let's change the prose here to read like this:

Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax.
In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p master^^{tree}`.
If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`.

Or something like that. It's a bit more idiomatically English.

NOTE heading style changed and its content rephrased
====
* Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax
* In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`
* If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`
Copy link
Member

Choose a reason for hiding this comment

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

Interesting. Why did you set this using bullets?

image

Let's just write it as a single paragraph, I think that flows better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

list converted to single paragraph

[NOTE]
====
Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`. If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, one more request: could you reformat this with one sentence on each source-code line? It makes reviewing PRs much easier in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure no problem

changed to one sentence on each source-code line
If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`
====

Copy link
Member

Choose a reason for hiding this comment

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

Oh man, I hate to do this to you again, but I have one last request (I promise). Looking at how this renders in context:

image

The "here's what you should do, and here's what it looks like when you do it" flow is interrupted by this note block. Could you move it just below the code block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure no problem

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hope these formatting rules are defined somewhere so that people could just read and follow it.

note block moved below code block
@ben ben merged commit 96cb0a9 into progit:master Mar 16, 2018
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.

2 participants