8 ms·
Git 2.9 released
- neogenix 10y ago"In 2.9, Git's diff engine learned a new heuristic: it tries to keep hunk boundaries at blank lines, shifting the hunk "up" whenever the bottom of the hunk matches the bottom of the preceding context, until we hit a blank line. " I like the new diff improvements
- emmelaich 10y agoIn a few (relatively) short years, git's diff has improved on all the other diffs out there.
- darfs 10y agoI didnt even know about the mentioned diff-script: https://github.com/git/git/blob/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/blob/master/contrib/diff-highligh... It gives pretty nice output :-) I should definitely learn more about extending git!
- Spiritus 10y agoThere's also this https://github.com/so-fancy/diff-so-fancy https://github.com/so-fancy/diff-so-fancy
- michaelmior 10y ago+1 for this. I started using it a few months ago for all my git diffs and I quite like the output. The biggest thing for me is being able to easily see partial line changes.
- 0942v8653 10y agoRequires Node though. Not sure that many people have that installed.
- TimWolla 10y agoIt does not: > For convenience, the recommended installation is via NPM. If you'd prefer, you may choose to do a manual installation instead. (highlighting by me) It is written in Perl.
- ymse 10y agoWait, what? A perl app distributed through NPM? What's next, a node app on CPAN? Color me perplexed.
- dietrichepp 10y agoThere are a lot of non-JS packages in NPM. The Closure compiler, for example.
- maverickwoo 10y agoMy favorite git diff extension is the side-by-side diff by cdiff: https://pypi.python.org/pypi/cdiff https://pypi.python.org/pypi/cdiff It also features word-level change highlights and other common flares.
- forrestthewoods 10y agoI still prefer Araxis. http://www.araxis.com/merge/index.en http://www.araxis.com/merge/index.en
- zwieback 10y agoIt's the absolute best, been using it for years.
- tomtheengineer 10y agoBeyond Compare is the best I've found (especially for complex merges): http://www.scootersoftware.com/ http://www.scootersoftware.com/
- philliphaydon 10y agoMe too. I tried ataxia for about 6 months and hated it, got told about beyond compare, paid for a license after only a few days of the trial .
- forrestthewoods 10y agoBeyond Compare is great. I prefer Araxis. I think most people would be very happy with one of the two. Whichever you happen to prefer.
- merb 10y agoI use: http://www.kaleidoscopeapp.com/ http://www.kaleidoscopeapp.com/
- broodbucket 10y agoDoes anyone know if this only works when displaying diffs, or when generating them? It'd definitely be nice if diffs were more readable when sent to mailing lists, i.e. from git format-patch.
- creshal 10y agoI'm fairly sure this applies only to the generating engine. (Otherwise it'd somehow need to reformat old diffs on the fly.)
- avar 10y agoReformat old diffs? If you're under the impression that Git stores diffs you're mistaken. It stores the full file contents and delta-compresses them later. Diffs in Git are purely a presentation format for human consumption.
- creshal 10y ago> Diffs in Git are purely a presentation format for human consumption. git format-patch says hi. Obviously the diff engine changes won't apply to already generated text diffs.
- hibbelig 10y agoYou can pipe an existing diff through diff-so-fancy or diff-highlight: cat foo.diff | diff-so-fancy I've never tried, but that's what the doc says. [time passes] Oh yes, it seems to work. It doesn't do colors when I try it, but that's probably a misconfiguration on my side. It's how this is intended to be used.
- spb 10y agoI don't understand why Git can't just make the [histogram algorithm][1] default, which has better performance than the base Myers algorithm, and is already built to integrate this type of heuristics (without the bugs that caused this patch to get held back). [1]: http://stackoverflow.com/questions/32365271/whats-the-difference-between-git-diff-patience-and-git-diff-histogram http://stackoverflow.com/questions/32365271/whats-the-differ...
- wscott 10y agoCool. BitKeeper internal diff, used for recording history and displaying changes has done this since 2001. https://gist.github.com/wscott/c403526ca19a210c13ad649136c15608 https://gist.github.com/wscott/c403526ca19a210c13ad649136c15... http://bkbits.net/u/bk/bugfix/?PAGE=patch&REV=3bdee65dgEb_uMb7G9RGTpivu4A1tA http://bkbits.net/u/bk/bugfix/?PAGE=patch&REV=3bdee65dgEb_uM...
- Rafert 10y agoDoes anybody know if the new diff heuristic engine takes info from a .gitattributes file in to account? When using git diff to view changes it already makes a difference, see http://urbanautomaton.com/blog/2011/07/28/git-grep-and-language-specific-diffs/ http://urbanautomaton.com/blog/2011/07/28/git-grep-and-langu...
- exDM69 10y agoThe new "rebase -x" seems really useful. It runs a test script on all patches in the history, making it useful for getting a bunch of patches tested for merging at once. This makes it easier to not have broken commits (e.g. ones that don't build) in master, which in turn makes git bisect more useful.
- mr_sturd 10y ago> Faster and more flexible submodules I have a big, monolithic repository which I'm looking to break up in a migration to Git. If I run; git submodule split -P <path_to_sm> -b <name_of_branch> --jobs=4 Will I see the same improvements, as documented?
- umanwizard 10y ago> I have a big, monolithic repository which I'm looking to break up in a migration to Git. Why?
- ansible 10y agoNot the OP, but if it is big enough, common tasks such as 'git status' can take seconds to complete, which is annoying. That said, I won't be using git submodules again on another project, it was a bit cumbersome for my taste.
- deleted 10y ago[deleted]
- rplnt 10y agoI haven't been following releases for a while, it's nice to see that submodules can now (2.8) be actually used. Just curious, were there any changes to sparse-checkout? It had abysmal performance in pre-2.x if you threw more elaborate paths at it, or more paths in general.
- coldpie 10y agoWe've been using submodules for almost a decade. It's easy to make mistakes, which is bad, but they're hardly unusable.
- rplnt 10y agoWell, I might overstated how slow it was to check them out in serial. They are still PITA thanks to specific behavior, missing features (both in git and in 3rd party tools such as bitbucket), etc.. The benefits oftentimes overshadow the issues with them, but there are drawbacks to using them.
- fidz 10y agoWhat is the algorithm of heuristics diff? Is it comparing longest-match? So, if i originally have x b n then adding x a n on top of it, it will become x a n x b n How can i know that i add x-a-n? Basically, isn't it comparing x-b-n and detect it has changes on 'b' block, so the 'b' block become a-n-x-b? Edit: My bad, didn't see this https://news.ycombinator.com/item?id=11915351 https://news.ycombinator.com/item?id=11915351. It has been explained there.
- Spiritus 10y agoBitbucket[1] also mentions a few other new cool stuff in 2.9, like making the `--verbose` flag to `git commit` default: git config −−global commit.verbose true [1] https://blog.bitbucket.org/2016/06/13/git-2-9/ https://blog.bitbucket.org/2016/06/13/git-2-9/
- comfydragon 10y agoMaybe I'm missing something, but that link doesn't say commit.verbose is true by default, it just documents the new setting you can set.
- sasvari 10y agoby default it is false. but commit.verbose is introduced by git 2.9. setting it before 2.9 didn't have any effect.
- hkjgkjy 10y agoOT The new diff script (https://github.com/git/git/blob/master/contrib/diff-highlight/diff-highlight https://github.com/git/git/blob/master/contrib/diff-highligh...) is juicy indeed. It is written in Perl. The Perl interpreter is available on most UNIX systems, so that's handy. I wonder if there is any Lisp-like language that is as common, that you can write scripts and expect them to run on most systems. Would be nice since Lisp languages have very few concepts to learn...
- tveita 10y agoGuile may be the closest, but it failed to gain much traction despite support in some popular GNU tools like GDB. It's certainly not installed on most systems, but it at least has a tiny chance of being present.
- creshal 10y agoOn Arch Linux it's a dependency of both gdb and make, but it seems that other distributions go out of their way to avoid shipping it (Debian e.g. builds gdb without a hard dependency on it, and you need to install a separate make-guile package to get guile-enabled make).
- s_kilk 10y agoIs guile part of the default packages on any unix-alike distribution though? The huge upside of perl is not necessarily that it's available, but that it's available by default.
- baldfat 10y agoI second the ability to use a Lisp language for this also (Racket Please).
- peff 10y agoI hope to one day push the highlighting inside of git itself. That should make it more efficient, and we can do a true LCS diff to find the common parts, rather than the front/back heuristic it currently does (see the diff-highlight README for the gory details). It's just a little complicated because of the way it interacts with existing internal diff features (in particular the whitespace-error highlighting).
- nilsjuenemann 10y agoIs there already a pre-built package for MacOSX?
- throwaway745234 10y agoHomebrew has it.
- donatj 10y agoI sadly usually wait for the official AppleGit Xcode tools release for the Keychain integration I'm so sadly dependent on.
- sxg 10y agoI'm not exactly sure what your use case is, but would this help? https://help.github.com/articles/caching-your-github-password-in-git/ https://help.github.com/articles/caching-your-github-passwor...
- qwyxzy 10y agoI use brew'd git alongside git credential-osxkeychain.
- modoc 10y agoThe 2.9 git install from homebrew prompted me for keychain access and then just "worked", this morning. My first time using brew git. So you may want to give it a whirl.
- gunn 10y agohttps://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.xz https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.xz (as used by homebrew)
- amitshekhar 10y agocan anybody help in adding submodule in my project https://github.com/amitshekhariitbhu/AndroidNetworking https://github.com/amitshekhariitbhu/AndroidNetworking using new git 2.9
- desireco42 10y agoGreat release. Submodules are bad practice riddled with problems, I think it wouldn't be bad to remove this feature at all, that way no-one will be have an option to use it.
- riscy 10y agoI use submodules and they work fine. What is so bad about them that I shouldn't be using them?
- ithkuil 10y agoHere's some good posts about submodules and alternatives, so you can make up your own mind: http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/ http://blogs.atlassian.com/2013/05/alternatives-to-git-submo... https://codingkilledthecat.wordpress.com/2012/04/28/why-your-company-shouldnt-use-git-submodules/ https://codingkilledthecat.wordpress.com/2012/04/28/why-your...
- riscy 10y agoFrom what I've gathered skimming the numerous blog posts venting about submodules, it seems that people have trouble with submodules because they are trying to integrate them into a workflow they work poorly in (i.e., rapidly changing modules). There seems to be room for improvement for that type of usage, given what people are saying, but I wonder if there have been any changes to submodules since those posts (many of them are dated around 2011-2012). My own positive experience with submodules involves dependencies that only occasionally change; I can always point to a specific tag that should be used.
- mnsc 10y agoHow do you point to a specific tag? Do you set branch : (tag)?
- Ace17 10y agoYes. One should avoid to extract a component from the repo as a submodule too early, i.e when the interface of the component is not mostly stabilized. If each commit in your "main" module is paired with a commit in your submodules, then you might be missing the point of module separation.
- cpdean 10y ago'git' is the name of the command line interface. the VCS is technically called "git's monster"
- rco8786 10y agoOver/under until git supports emoji in commit messages?
- creshal 10y agoWhy would it need dedicated support for it? It's already unicode aware.
- milkey_mouse 10y agoI've put emoji in commit messages. Git already supports Unicode (mostly). Just make sure you're using a Unicode-aware terminal.
- systemz 10y agoAre they planning to simplify standard day to day command from flag nightmare to something that mortal can actually remember?
- lexicality 10y agoWhat flags do you have particular problems with and what could you see as a replacement for them?
- icefox 10y agoHidden at the end of the changelog is the addition of the the new config entry: "core.hooksPath" which lets you specify globally or per repository where hooks should point to. In the Git-hooks project we have been using the init.templatedir which this replaces (as it is better), but for those that can't upgrade to 2.9 you can use init.templatedir and some variation of what Git-Hooks does to obtain similar results. https://github.com/icefox/git-hooks/blob/master/git-hooks#L165 https://github.com/icefox/git-hooks/blob/master/git-hooks#L1...
- avar 10y agoSweet. I implemented that feature vaguely fearing that nobody except me was going to use it, in my case to ease setting up "auditing" hooks on a centralized Git server. Awesome that you find in useful.
- spb 10y agoOh man, excellent. I've wanted this feature in my [Plushu][] project for years: this will make my code significantly simpler. [Plushu]: http://comments.gmane.org/gmane.comp.version-control.git/253790 http://comments.gmane.org/gmane.comp.version-control.git/253...
- msoad 10y agoOh I should compare the new coloring with DiffSoFancy. I think DiffSoFancy still wins!