Commit Graph

4455 Commits

Author SHA1 Message Date
Ben Straub
ec7e240ba4 Add rev-list example to makefiles 2013-04-09 05:07:12 +04:00
Ben Straub
1aa21fe3b8 Deprecate git_revparse_single and _rangelike 2013-04-09 05:07:04 +04:00
Ben Straub
8480eef7ee Implement unified git_revparse 2013-04-08 16:36:11 +04:00
Ben Straub
4d13d07ab2 Propose unified rev-parse API 2013-04-08 16:35:09 +04:00
Vicent Marti
812e5aea59 test: Add missing NULLs 2013-04-07 07:23:08 +02:00
Vicent Marti
d9ecaf8c6f Merge remote-tracking branch 'gnprice/revwalk' into development 2013-04-07 07:22:38 +02:00
Greg Price
2e2332857d examples: a test, for rev-list
This test file could probably be improved by a framework like
the one in git.git:t/, or by using a language like Python instead
of shell.

The other examples would benefit from tests too.  Probably best
to settle on a framework to write them in, then add more tests.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
8f7f5e5543 examples: rev-list
This demonstrates parts of the interface for specifying revisions that
Git users are familiar with from 'git rev-list', 'git log', and other
Git commands.  A similar query interface is used in out-of-core
command-line programs that browse a Git repo (like 'tig'), and may be
useful for an 'advanced search' interface in GUI or web applications.

In this version, we parse all the query modifiers we can support with
the existing logic in revwalk: basic include/exclude commits, and the
ordering flags.  More logic will be required to support '--grep',
'--author', the pickaxe '-S', etc.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
af079d8bf6 revwalk: Parse revision ranges
All the hard work is already in revparse.

Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Greg Price
b208d90022 revparse: Parse range-like syntax
Signed-off-by: Greg Price <price@mit.edu>
2013-04-06 20:51:16 -07:00
Vicent Martí
2274483727 Merge pull request #1456 from ben/fix-general-example
Fix the general.c example to run against testrepo.git
2013-04-04 11:46:54 -07:00
Ben Straub
f8591e519a General example: run against testrepo.git
Fixes #1455
2013-04-04 11:44:50 -07:00
Vicent Martí
432b8c11b8 Merge pull request #1453 from ethomson/refdb_export
Properly GIT_EXPORT git_reference__alloc
2013-04-02 17:09:35 -07:00
Edward Thomson
c869e26878 export git_reference__alloc 2013-04-02 18:57:42 -05:00
Ben Straub
734aa82642 Merge pull request #1452 from nulltoken/fix/branch_doc
branch: Fix git_branch_create() documentation
2013-04-01 13:28:08 -07:00
nulltoken
b08c317346 branch: Fix git_branch_create() documentation 2013-04-01 22:01:13 +02:00
Vicent Martí
08283cbdb8 Merge pull request #1448 from phkelley/development
Avoid pre-Win7 WinHTTP self-redirect quirk
2013-04-01 07:12:49 -07:00
Philip Kelley
b39f969732 Fix whitespace in src/win32/version.h 2013-03-31 23:04:14 -04:00
Philip Kelley
5c5eeba6fd Add git_has_win32_version helper 2013-03-31 22:22:33 -04:00
Greg Price
2932c8826a revwalk: refactor tests a bit
Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
Greg Price
06e6eab0e2 revwalk tests: better diagram of example repo
The purported command output was already inaccurate, as the refs
aren't where it shows.  In any event, the labels a reader of this
file really needs are the indices used in commit_sorting_*, to make
it possible to understand them by referring directly from those
arrays to the diagram rather than from the index arrays, to commit_ids,
to the diagram.  Add those.

Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
Greg Price
804c5f5627 Fix puzzling doc comment
Signed-off-by: Greg Price <price@mit.edu>
2013-03-31 15:33:22 -07:00
Vicent Martí
c45d9c4661 Merge pull request #1451 from nulltoken/topic/support_taggerless_tags
Support tags with no tagger nor message
2013-03-31 14:07:15 -07:00
Philip Kelley
8cc2f2d86f Win32 error reporting: Support WinHTTP errors 2013-03-31 12:10:27 -04:00
nulltoken
24cb87e2a6 tag: Fix parsing when no tagger nor message 2013-03-31 14:36:51 +02:00
nulltoken
5a5bd64024 tests: Fix indentations 2013-03-31 14:17:38 +02:00
Philip Kelley
0227fa2a35 Avoid pre-Win7 WinHTTP self-redirect quirk 2013-03-30 21:36:04 -04:00
Carlos Martín Nieto
81b8c9df46 transport: don't try to export nonexistent function 2013-03-30 04:50:53 +01:00
Edward Thomson
f938259f7c Merge pull request #1446 from ethomson/free
Clean up some memleaks in tests
2013-03-29 16:44:00 -07:00
Edward Thomson
0e60b637ea free! 2013-03-29 18:36:11 -05:00
Vicent Martí
1d5220dcd1 Merge pull request #1445 from ethomson/reset_unmerged
remove unmerged files during reset hard
2013-03-29 10:13:54 -07:00
Edward Thomson
54a1a04291 remove unmerged files during reset hard 2013-03-29 12:07:00 -05:00
Russell Belfer
8cfd54f0d8 Fix Windows/Win32 warning 2013-03-26 12:27:15 -07:00
Vicent Martí
0b061b5bfa Merge pull request #1436 from schu/opts-cache-size
opts: allow configuration of odb cache size
2013-03-26 11:05:57 -07:00
Vicent Martí
86d24ce40c Merge pull request #1439 from arrbee/recurse-ignored-dirs
Several diff and status fixes
2013-03-26 10:42:30 -07:00
Russell Belfer
ccfa68055c Fix some diff ignores and submodule dirty workdir
This started out trying to look at the problems from issue #1425
and gradually grew to a broader set of fixes.  There are two core
things fixed here:

1. When you had an ignore like "/bin" which is rooted at the top
   of your tree, instead of immediately adding the "bin/" entry
   as an ignored item in the diff, we were returning all of the
   direct descendants of the directory as ignored items.  This
   changes things to immediately ignore the directory.  Note that
   this effects the behavior in test_status_ignore__subdirectories
   so that we no longer exactly match core gits ignore behavior,
   but the new behavior probably makes more sense (i.e. we now
   will include an ignored directory inside an untracked directory
   that we previously would have left off).
2. When a submodule only contained working directory changes, the
   diff code was always considering it unmodified which was just
   an outright bug. The HEAD SHA of the submodule matches the SHA
   in the parent repo index, and since the SHAs matches, the diff
   code was overwriting the actual status with UNMODIFIED.

These fixes broke existing tests test_diff_workdir__submodules and
test_status_ignore__subdirectories but looking it over, I actually
think the new results are correct and the old results were wrong.
@nulltoken had actually commented on the subdirectory ignore issue
previously.

I also included in the tests some debugging versions of the
shared iteration callback routines that print status or diff
information.  These aren't used actively in the tests, but can be
quickly swapped in to test code to give a better picture of what
is being scanned in some of the complex test scenarios.
2013-03-25 23:58:40 -07:00
Russell Belfer
37ee70fab4 Implement GIT_STATUS_OPT_EXCLUDE_SUBMODULES
This option has been sitting unimplemented for a while, so I
finally went through and implemented it along with some tests.

As part of this, I improved the implementation of
GIT_DIFF_IGNORE_SUBMODULES so it be more diligent about avoiding
extra work and about leaving off delta records for submodules to
the greatest extent possible (though it may include them still
if you are request TYPECHANGE records).
2013-03-25 22:19:39 -07:00
Vicent Martí
d2a4a54bf9 Merge pull request #1438 from ethomson/checkout_stat
don't stat until the file is written
2013-03-25 21:46:51 -07:00
Edward Thomson
d828f118b3 don't stat until the file is written 2013-03-25 18:16:02 -07:00
Russell Belfer
0c289dd7c6 Recursing into ignored dirs for diff and status
This implements working versions of GIT_DIFF_RECURSE_IGNORED_DIRS
and GIT_STATUS_OPT_RECURSE_IGNORED_DIRS along with some tests for
the newly available behaviors.  This is not turned on by default
for status, but can be accessed via the options to the extended
version of the command.
2013-03-25 16:40:16 -07:00
Vicent Martí
f2850f33ca Merge pull request #1437 from phkelley/redirect
http: Support 302 Found (arrbee did most of the work)
2013-03-25 15:30:37 -07:00
Philip Kelley
f273b5d6a1 Add a valgrind suppression for glibc's getaddrinfo cache 2013-03-25 18:15:54 -04:00
Philip Kelley
35e0f3c629 Refine the redirect check condition 2013-03-25 17:59:30 -04:00
Vicent Martí
f17951d6ea Merge pull request #1431 from libgit2/autocrlf-fixes
Fix crlf handling, particularly when autocrlf=true
2013-03-25 14:42:53 -07:00
Philip Kelley
2c7f7a66e9 http: Support 302 Found (arrbee did most of the work) 2013-03-25 17:35:36 -04:00
Russell Belfer
3658e81e34 Move crlf conversion into buf_text
This adds crlf/lf conversion functions into buf_text with more
efficient implementations that bypass the high level buffer
functions.  They attempt to minimize the number of reallocations
done and they directly write the buffer data as needed if they
know that there is enough memory allocated to memcpy data.

Tests are added for these new functions.  The crlf.c code is
updated to use the new functions.

Removed the include of buf_text.h from filter.h and just include
it more narrowly in the places that need it.
2013-03-25 14:20:07 -07:00
Russell Belfer
050ab9950d Fix up checkout file contents checks
This fixes of the file contents checks in checkout to give
slightly better error messages by directly calling the underlying
clar assertions so the file and line number of the top level call
can be reported correctly, and renames the helpers to not start
with "test_" since that is kind of reserved by clar.

This also enables some of the CRLF tests on all platforms that
were previously Windows only (by pushing a check of the native
line endings into the test body).
2013-03-25 14:13:53 -07:00
Edward Thomson
4a15ea869c don't convert CRLF to CRCRLF 2013-03-25 14:03:16 -07:00
Russell Belfer
1098cfaeca Test fixes and cleanup
This fixes some places where the new tests were leaving the test
area in a bad state or were freeing data they should not free.
It also removes code that is extraneous to the core issue and
fixes an invalid SHA being looked up in one of the tests (which
was failing, but for the wrong reason).
2013-03-25 14:03:16 -07:00
Sven Strickroth
b8acb775e2 Added some tests for issue #1397
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2013-03-25 14:03:16 -07:00