Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

git-show show HEAD if no commit specified #481

Closed
wants to merge 1 commit into from
Closed

git-show show HEAD if no commit specified #481

wants to merge 1 commit into from

Conversation

fmnoise
Copy link
Contributor

@fmnoise fmnoise commented Jul 6, 2016

No description provided.

@akonwi
Copy link
Owner

akonwi commented Jul 7, 2016

If you enter head it achieves the same thing. I wouldn't want to have a null input result in valid output. Because there is an input required I think there should be a responsibility to enter which commit to show.

There are two alternatives I'm more comfortable with:

  1. Change the placeholder of the input to make it clear that the default will be HEAD
  2. Create a second command with the label 'Show HEAD' that won't show the input as a second step

Could you also add tests around what you add?

@fmnoise
Copy link
Contributor Author

fmnoise commented Jul 7, 2016

Actually now it just fails silently if nothing has entered. If you'll open dev tools console there's an error:
image

That's why I decided to make command execution most close as it is when you enter git show in console without adding any commit hash.
I'll add some tests.
Also not sure why do we need this code, as it's does nothing
https://github.com/akonwi/git-plus/blob/master/lib/models/git-show.coffee#L53

@akonwi
Copy link
Owner

akonwi commented Jul 7, 2016

Yea understandable. Will you go the route of making it obvious in the placeholder that it will default to HEAD?

Feel free to remove line 53 as well

@akonwi
Copy link
Owner

akonwi commented Oct 31, 2016

I've merged this

@akonwi akonwi closed this Oct 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants