Closed stevage closed 9 years ago
So what you want is: diff current file against a branch
I use
H
to view all commits between a branchEnter
Thanks, I didn't know about those. If there was a way to see the sum of all the diffs (rather than just one diff at a time) it would be perfect.
On Thu, Sep 17, 2015 at 5:20 AM, Simon notifications@github.com wrote:
So what you want is: diff current file against a branch
I use
- git: branch
- than I uses H to view all commits between a branch
- I can enter a commit by pressing Enter
— Reply to this email directly or view it on GitHub https://github.com/divmain/GitSavvy/issues/237#issuecomment-140856631.
Just hit ‘f’ instead of ‘H’ to view the diff between the HEAD and selected branch. This is listed in the keyboard reference in the Branch view.
On 17 Sep 2015, at 11:35 AM, Steve Bennett notifications@github.com wrote:
Thanks, I didn't know about those. If there was a way to see the sum of all the diffs (rather than just one diff at a time) it would be perfect.
On Thu, Sep 17, 2015 at 5:20 AM, Simon notifications@github.com wrote:
So what you want is: diff current file against a branch
I use
- git: branch
- than I uses H to view all commits between a branch
- I can enter a commit by pressing Enter
— Reply to this email directly or view it on GitHub https://github.com/divmain/GitSavvy/issues/237#issuecomment-140856631.
— Reply to this email directly or view it on GitHub https://github.com/divmain/GitSavvy/issues/237#issuecomment-140940216.
Kevin Yank @sentience http://kevinyank.com/
I noticed that shortcut but it doesn't work for me:
'utf-8' codec can't decode byte 0xa2 in position 880619: invalid start byte
@stevage, that's strange. It has been known to happen when you have non-UTF-8 data in your Git history. We have fallbacks in place for a couple of methods, but probably not all. Can you tell me the exact repro steps for reaching this condition? If the repo in question is public, even better, as I would be able to duplicate the error on my own machine.
Ok - actually when I try other branches, some of them do work. So that's exciting :)
Repo is: https://github.com/terriajs/terriajs
On branch region-mapping-advanced-matching, attempting to diff hjson
or
region-mapping-feedback
788fe78 hjson (origin/hjson)
▸ f4f9a7c region-mapping-advanced-matching
(origin/region-mapping-advanced-matching)
7923f05 region-mapping-feedback
Every other branch that failed (another 10-15) seem to be ones that have been deleted from the remote on Github. I don't know if that's significant.
Not sure what other repro steps you need. Sublime build 3083, registered, OSX Mavericks.
Yeah, there's definitely non UTF-8 data in there. Example:
git diff --no-color origin/region-mapping-feedback..region-mapping-advanced-matching wwwroot/data/WW15MGH.DAC
Unfortunately, since this is binary data, even falling back to windows-1252
encoding will fail (windows-1252
will usually render text, if somewhat garbled, if the encoding is unknown). I can't think of a good approach to showing some of the data, especially since it would break user expectations to (for example) only show a partial diff and exclude the changes to the binaries.
Running branch comparisons should work fine for you if no binary files have changed. Otherwise, I'm open to suggestions, but GitSavvy probably isn't well suited to this specific case.
¯\_(ツ)_/¯
Interesting - I've never even seen that file (I assume it's a test case that means something to someone else). Anyway, I have a few suggestions :)
gitattributes
and git diff --textconv
to render something as the binary diff (even if just the words "skipping binary diff")...
") (Or point out other workarounds.)1 & 2 are problematic, because the place where to decoding occurs has no context for what else is going on. This could be conditionally handled in multiple places using a custom exception hierarchy (something I'll implement eventually), but option 3 should be good enough for now. (c00374c)
Maybe I just haven't found the right way yet, but it would be good to have a way to view changes in a file relative to another branch. Diff obviously compares uncommitted changes in the current file against the current branch. How about comparing committed changes in the current file against some other branch?
(The main use case is code review, evaluating PRs etc.)