Commit Graph

5266 Commits

Author SHA1 Message Date
Russell Belfer
a5140f4dda Fix rename detection for tree-to-tree diffs
The performance improvements I introduced for rename detection
were not able to run successfully for tree-to-tree diffs because
the blob size was not known early enough and so the file signature
always had to be calculated nonetheless.

This change separates loading blobs into memory from calculating
the signature.  I can't avoid having to load the large blobs into
memory, but by moving it forward, I'm able to avoid the signature
calculation if the blob won't come into play for renames.
2013-07-24 17:11:49 -07:00
Arthur Schreiber
847c679309 Allow Makefile.embed to be used when cross-compiling
This allows libgit2 to be cross-compiled (e.g. when building native rugged binaries for windows from Linux or OS X).

```
CROSS_COMPILE=i686-w64-mingw32 make -f Makefile.embed
```
2013-07-25 00:26:51 +02:00
Russell Belfer
f5c4d02251 Fix incorrect comment 2013-07-24 13:44:35 -07:00
Russell Belfer
397357a048 Add rename test that used to be really slow
Before the optimization commits, this test used to take about 20
seconds to run on my machine.  Afterwards, there is still a couple
seconds of data setup, but the actual diff and rename detection
runs in a fraction of a second.
2013-07-24 13:12:00 -07:00
Russell Belfer
427cc255df Use local variables in hash calc to avoid aliasing 2013-07-24 13:11:11 -07:00
Russell Belfer
18e9efc425 Don't check rename if file size difference is huge 2013-07-24 13:10:16 -07:00
Russell Belfer
69c66b554e Don't do text diff unless content will be used 2013-07-24 13:09:33 -07:00
Russell Belfer
39a1a66242 Don't unload diff data unless loaded 2013-07-24 13:09:07 -07:00
Russell Belfer
eb1c1707ab Restore GIT_DIFF_LINE_BINARY usage
This restores the usage of GIT_DIFF_LINE_BINARY for the diff
output line that reads "Binary files x and y differ" so that it
can be optionally colorized independently of the file header.
2013-07-23 15:45:58 -07:00
Russell Belfer
df40f3981c Make compact output more like core Git 2013-07-23 15:18:28 -07:00
Russell Belfer
197b8966db Add hunk/file headers to git_diff_patch_size
This allows git_diff_patch_size to account for hunk headers and
file headers in the returned size.  This required some refactoring
of the code that is used to print file headers so that it could be
invoked by the git_diff_patch_size API.

Also this increases the test coverage and fixes an off-by-one bug
in the size calculation when newline changes happen at the end of
the file.
2013-07-23 14:34:31 -07:00
Russell Belfer
cdbcb8dd80 Merge pull request #1745 from libgit2/doc-fixes
Doc fixes
2013-07-23 09:43:07 -07:00
Carlos Martín Nieto
64061d4a14 remote: fix git_remote_download() documentation
The description of what the function does hasn't been true for quite a
while. Change it to reflect the way it currently works.

While here, remove an even older comment about missing features that
have been implemented.
2013-07-23 10:51:14 +02:00
Carlos Martín Nieto
c05a55b056 Clean up some documentation
clang's docparser highlighted these.
2013-07-23 09:40:19 +02:00
Vicent Martí
e5bdf82976 Merge pull request #1732 from libgit2/revwalk-glob-should-ignore-invalid
Invalid refs on disk cause revwalk globbing to fail
2013-07-22 23:59:08 -07:00
Russell Belfer
b4a4cf24a5 Add git_diff_patch_size() API
This adds a new API to get the size in bytes of the diffs in a
git_diff_patch object.
2013-07-22 16:07:56 -07:00
Russell Belfer
4cee9b8618 Update init and clean for revwalk::basic tests
The new tests don't always want to use the same fixture data as
the old ones so this makes it configurable on a per-test basis.
2013-07-22 11:41:23 -07:00
Russell Belfer
989710d982 Fix warning message about mismatched types 2013-07-22 11:22:55 -07:00
Russell Belfer
c77342ef1c Use pool for loose refdb string allocations
Instead of using lots of strdup calls, this adds a memory pool to
the loose refs iteration code and uses it for keeping track of the
loose refs array.  Memory usage could probably be reduced even
further by eliminating the vector and just scanning by adding the
strlen of each ref, but that would be a more intrusive changes.

This also updates the error handling to be more thorough about
checking for failed allocations, etc.
2013-07-22 11:20:34 -07:00
Russell Belfer
b71071313f git_reference_next_name must match git_reference_next
The git_reference_next API silently skips invalid references when
scanning the loose refs.  The git_reference_next_name API should
skip the same ones even though it isn't creating the reference
object.

This adds a test with a an invalid loose reference and makes sure
that both APIs skip the same entries and generate the same results.
2013-07-22 11:01:19 -07:00
Martin Woodward
1cd9dc29b7 Merge pull request #1743 from ethomson/readme
Clarify when to use github issues
2013-07-19 11:14:22 -07:00
Edward Thomson
bef59b1be4 Update README.md 2013-07-19 12:56:47 -05:00
Ben Straub
97309dd025 Merge pull request #1726 from crazymaster/development
git_buf_text_gather_stats doesn't work for multi-byte characters
2013-07-19 10:43:53 -07:00
Edward Thomson
41a93cc6e5 Clarify when to use github issues
Suggest that github issues are to be used for bug reports, while questions about usage should be directed to StackOverflow.
2013-07-19 12:43:08 -05:00
Ben Straub
847b8e0e44 Merge pull request #1742 from martinwoodward/Refresh-Readme
Refresh readme and contributing guidance
2013-07-19 10:29:47 -07:00
Martin Woodward
6ca83665c7 Update contributing guidance to explain PR flow
Updating the contributing guidance to explain a bit more about how we use
PR's
2013-07-19 18:20:58 +01:00
Martin Woodward
3e3d332b4c Tidy up the methods of contacting the project
Updated the methods of getting involved with the project and asking
questions.
2013-07-19 18:04:11 +01:00
Ben Straub
275d8d55b2 Typo 2013-07-18 09:37:59 -07:00
Vicent Martí
794003650e Merge pull request #1736 from ben/default-to-cdecl
Switch default calling convention to cdecl
2013-07-18 06:26:25 -07:00
Ben Straub
99a9c86cb6 Merge pull request #1722 from libgit2/ntk/fix/issue_1722
git_revparse_ext: should return a NULL reference  when the revparse expression doesn't lead to a reference
2013-07-17 20:08:15 -07:00
Vicent Martí
d2db351cf6 Merge pull request #1735 from ethomson/ignored_are_not_rename_candidates
don't include ignored as rename candidates
2013-07-17 16:12:15 -07:00
Edward Thomson
d55bed1a25 don't include ignored as rename candidates 2013-07-17 16:55:00 -05:00
Ben Straub
e49dc6872d Switch default calling convention to cdecl. 2013-07-17 14:06:31 -07:00
Ben Straub
4e05fa7db4 Merge pull request #1731 from alindeman/patch-1
Small grammar fix in docs
2013-07-15 20:45:18 -07:00
Andy Lindeman
51b0397a66 Small grammar fix in docs 2013-07-15 23:40:57 -04:00
Vicent Martí
f538515079 Merge pull request #1728 from ivoire/small_fixes
Small fixes
2013-07-15 09:45:04 -07:00
Vicent Martí
3f8086e069 Merge pull request #1729 from tiennou/remote-owner
Add `git_remote_owner`.
2013-07-15 09:44:02 -07:00
Etienne Samson
85e1eded6a Add git_remote_owner 2013-07-15 16:31:25 +02:00
Rémi Duraffort
c6451624c4 Fix some more memory leaks in error path 2013-07-15 16:29:18 +02:00
Rémi Duraffort
050af8bbe0 pack: fix memory leak in error path 2013-07-15 16:29:13 +02:00
Rémi Duraffort
8d6ef4bf78 index: fix potential memory leaks 2013-07-15 16:29:09 +02:00
Rémi Duraffort
9146f1e57e repository: clarify assignment and test order 2013-07-15 16:29:00 +02:00
crazymaster
d0b25d9dff Fix 2013-07-15 08:14:00 +09:00
crazymaster
2185dd6f99 Fix typo 2013-07-15 08:06:09 +09:00
crazymaster
b74d4478df Fix the initial line 2013-07-15 07:44:08 +09:00
crazymaster
19bee769d4 Revert "Replace Japanese characters with the encoded hexadecimal values"
This reverts commit a91e4d6b21.
2013-07-15 07:39:16 +09:00
crazymaster
a91e4d6b21 Replace Japanese characters with the encoded hexadecimal values 2013-07-15 07:30:18 +09:00
Russell Belfer
351733128c Merge pull request #1727 from alindeman/lookup-object-doc-fix
Fixes return type documentation
2013-07-14 15:16:08 -07:00
Andy Lindeman
960431c380 Fixes return type documentation 2013-07-14 18:08:54 -04:00
crazymaster
6550565af3 Fix gather_stats 2013-07-14 21:08:45 +09:00