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

Git Diff All on Commit #90

Closed
Zren opened this issue Jul 16, 2014 · 23 comments
Closed

Git Diff All on Commit #90

Zren opened this issue Jul 16, 2014 · 23 comments

Comments

@Zren
Copy link
Contributor

Zren commented Jul 16, 2014

Having a diff all underneath the commit message is one thing I liked about SublimeText's Git.

I added this Zren@4cd94df to open and focus on the diff all. Which allows the you to scroll down, then Ctrl+W to close it, and jump right to the commit message.

Could probably make this configurable if you go my route instead of combining the two like in SublimeText.

@nshtg
Copy link
Contributor

nshtg commented Jul 16, 2014

i Think that's like commit -v?

@Zren
Copy link
Contributor Author

Zren commented Jul 16, 2014

Oh huh,

-v
--verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template. Note that this diff output doesn’t have its lines prefixed with #.

Note that this diff output doesn’t have its lines prefixed with #.

It appears you have to delete those lines before commiting then.

I added -v to this https://github.com/akonwi/git-plus/blob/master/lib/models/git-commit.coffee#L67 git status -v. And it appended the diff. It was all commented out though, which lost syntax highlighting. Uncommenting (part of it) got syntax highlighting, but then it was added to the commit message.

Have to try Uncommenting the entire thing, and possible using -v in the commit command.

@nshtg
Copy link
Contributor

nshtg commented Jul 16, 2014

I will take a look at this matter at the weekend. --cleanup=scissors needs to be changed aswell.

@nwinkler
Copy link

👍 Would love to see the outgoing changes while writing a commit message.

@MaikuMori
Copy link

This would be amazing to have.

@hco
Copy link

hco commented Dec 2, 2014

Would really love this.

@jeepkd
Copy link

jeepkd commented Jun 30, 2015

+1

@r-darwish
Copy link

+1

@BluePhoenix
Copy link

+1 This would be helpful, as I like double checking what gets committed.

@akonwi
Copy link
Owner

akonwi commented Dec 25, 2015

It turns out the git-language package syntax highlighting for the commit message supports the --verbose version of commits. I simply added diffs to the commit message and it worked. I'm pushing a new version with the setting turned off by default so take a look

@akonwi akonwi closed this as completed in 2b670cb Dec 25, 2015
@akonwi
Copy link
Owner

akonwi commented Dec 25, 2015

Don't take a look haha I need to comment out the diffs when actually making the commit

@akonwi akonwi reopened this Dec 25, 2015
@akonwi
Copy link
Owner

akonwi commented Dec 25, 2015

So it seems as if the --cleanup=scissors flag doesn't work if we pass in the path to the file through the --file flag. Though the cleanup can be done manually, I'm less thrilled about doing it that way. but that may the path I take

@akonwi
Copy link
Owner

akonwi commented Dec 26, 2015

If anyone would like to take a clone of the branch called '90' and test this feature, that'd be great. I'd like to make sure it works on someone else's machine as well

@tonibirrer
Copy link

Does this now work?

I've spotted this in the preferences, but it doesn't seem to have an effect.
image

@akonwi
Copy link
Owner

akonwi commented Jun 15, 2016

@tonibirrer This does not work yet. I'm not sure why that option is still around. It's also appearing for me though.

The first implementation had issues so I yanked it. I'll get back to working on it

akonwi added a commit that referenced this issue Jun 15, 2016
@akonwi
Copy link
Owner

akonwi commented Jun 15, 2016

I've update the branch called 90. I won't publish this until a few others try it out

@akonwi
Copy link
Owner

akonwi commented Jun 25, 2016

This is now hidden behind a toggle for experimental features which I pushed in the latest update.

@tonibirrer
Copy link

Very cool, it works now. Thanks!

@TrevorBurnham
Copy link

TrevorBurnham commented Jun 27, 2016

@akonwi I'm very happy to see this! The syntax used for rendering the diff isn't ideal, though.

Here's how the diff looks for me when I do a commit via Git Plus:

image

And here's the same diff when I run git commit from the command line:

image

I'd like to see Git Plus render the COMMIT_EDITMSG file the same way.

@akonwi
Copy link
Owner

akonwi commented Jun 30, 2016

@TrevorBurnham do you have the "Word diff" setting toggled on in the package settings? That setting will also be applied to the diff for the commit

@TrevorBurnham
Copy link

Aha! Turning off "Word diff" fixed that problem for me, and I can now customize the syntax styles to get what I want.

@akonwi
Copy link
Owner

akonwi commented Nov 9, 2016

Closing this since it's been a feature for a while now

@akonwi akonwi closed this as completed Nov 9, 2016
@twang2218
Copy link

I run into this issue today, thanks Git-Plus provides Word diff toggle for it, it really helpful. And I do think this word diff should turned off by default.

2017-01-11 11 14 35

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

No branches or pull requests