]> git.proxmox.com Git - libgit2.git/log
libgit2.git
11 years agoFix line numbering for patches with eofnl
Russell Belfer [Tue, 7 May 2013 14:15:39 +0000 (07:15 -0700)]
Fix line numbering for patches with eofnl

When a patch contained an eofnl change (i.e. the last line either
gained or lost a newline), the oldno and newno line number values
for the lines in the last hunk of the patch were not useful.  This
makes them behave in a more expected manner.

11 years agoImprove diff function docs
Russell Belfer [Tue, 7 May 2013 11:44:08 +0000 (04:44 -0700)]
Improve diff function docs

11 years agoMore tests for files with no newline at end
Russell Belfer [Tue, 7 May 2013 11:36:42 +0000 (04:36 -0700)]
More tests for files with no newline at end

11 years agoAdd GIT_DIFF_LINE_CONTEXT_EOFNL
Russell Belfer [Tue, 7 May 2013 11:32:17 +0000 (04:32 -0700)]
Add GIT_DIFF_LINE_CONTEXT_EOFNL

This adds a new line origin constant for the special line that
is used when both files end without a newline.

In the course of writing the tests for this, I was having problems
with modifying a file but not having diff notice because it was
the same size and modified less than one second from the start of
the test, so I decided to start working on nanosecond timestamp
support.  This commit doesn't contain the nanosecond support, but
it contains the reorganization of maybe_modified and the hooks so
that if the nanosecond data were being read by stat() (or rather
being copied by git_index_entry__init_from_stat), then the nsec
would be taken into account.

This new stuff could probably use some more tests, although there
is some amount of it here.

11 years agoMerge pull request #1547 from ethomson/win32_stat
Vicent Martí [Mon, 6 May 2013 13:51:21 +0000 (06:51 -0700)]
Merge pull request #1547 from ethomson/win32_stat

p_stat() should follow symlinks on windows

11 years agoMerge pull request #1526 from arrbee/cleanup-error-return-without-msg
Vicent Martí [Mon, 6 May 2013 13:45:53 +0000 (06:45 -0700)]
Merge pull request #1526 from arrbee/cleanup-error-return-without-msg

Make sure error messages are set for most error returns

11 years agoMerge pull request #1524 from jamill/clone_tagopts
Vicent Martí [Mon, 6 May 2013 13:45:40 +0000 (06:45 -0700)]
Merge pull request #1524 from jamill/clone_tagopts

By default do not set tagopt when cloning

11 years agoMerge pull request #1545 from ethomson/checkout_dirs_in_use
Vicent Martí [Mon, 6 May 2013 13:33:02 +0000 (06:33 -0700)]
Merge pull request #1545 from ethomson/checkout_dirs_in_use

allow checkout to proceed when a dir to be removed is in use (win32)

11 years agoMerge pull request #1550 from nvloff/fix_typo_in_branch_h
Russell Belfer [Mon, 6 May 2013 12:53:13 +0000 (05:53 -0700)]
Merge pull request #1550 from nvloff/fix_typo_in_branch_h

branch.h: fix typo in docs

11 years agobranch.h: fix typo in docs
Nikolai Vladimirov [Mon, 6 May 2013 12:31:26 +0000 (15:31 +0300)]
branch.h: fix typo in docs

11 years agoMerge pull request #1549 from nulltoken/fix/from_oids
Russell Belfer [Sun, 5 May 2013 15:01:18 +0000 (08:01 -0700)]
Merge pull request #1549 from nulltoken/fix/from_oids

Strict/lax commit API

11 years agocommit: make create_from_oids() accept plain oid
nulltoken [Sun, 5 May 2013 14:48:34 +0000 (16:48 +0200)]
commit: make create_from_oids() accept plain oid

11 years agocommit: guard create() against not owned trees
nulltoken [Sun, 5 May 2013 14:45:38 +0000 (16:45 +0200)]
commit: guard create() against not owned trees

11 years agop_stat() should follow symlinks on windows
Edward Thomson [Sat, 4 May 2013 17:04:39 +0000 (12:04 -0500)]
p_stat() should follow symlinks on windows

11 years agoDo not write tagopt configuration option on clone by default
Jameson Miller [Sat, 4 May 2013 16:14:40 +0000 (12:14 -0400)]
Do not write tagopt configuration option on clone by default

11 years agoRemove obsolete test for peel type
Russell Belfer [Sat, 4 May 2013 08:04:23 +0000 (01:04 -0700)]
Remove obsolete test for peel type

Peeling to an invalid type is now checked via an assert so this
test is no longer relevant.

11 years agoallow checkout to proceed when a dir to be removed is in use (win32)
Edward Thomson [Fri, 3 May 2013 23:39:44 +0000 (18:39 -0500)]
allow checkout to proceed when a dir to be removed is in use (win32)

11 years agoodb: Do not error out if an alternate ODB is missing
Vicent Marti [Fri, 3 May 2013 21:30:54 +0000 (23:30 +0200)]
odb: Do not error out if an alternate ODB is missing

11 years agoclar: Always generate the test suite
Vicent Marti [Fri, 3 May 2013 15:35:50 +0000 (17:35 +0200)]
clar: Always generate the test suite

11 years agoMerge pull request #1540 from ethomson/leaks
Vicent Martí [Fri, 3 May 2013 15:19:12 +0000 (08:19 -0700)]
Merge pull request #1540 from ethomson/leaks

fix some leaks

11 years agofix some leaks
Edward Thomson [Thu, 2 May 2013 22:22:13 +0000 (17:22 -0500)]
fix some leaks

11 years agoMerge pull request #1538 from ethomson/merge_warning_cleanup
Vicent Martí [Thu, 2 May 2013 20:42:16 +0000 (13:42 -0700)]
Merge pull request #1538 from ethomson/merge_warning_cleanup

braces

11 years agobraces
Edward Thomson [Thu, 2 May 2013 20:19:49 +0000 (15:19 -0500)]
braces

11 years agoMerge pull request #1537 from ethomson/merge_warning_cleanup
Vicent Martí [Thu, 2 May 2013 20:01:44 +0000 (13:01 -0700)]
Merge pull request #1537 from ethomson/merge_warning_cleanup

puns are not funny; type punning especially so

11 years agopuns are not funny; type punning especially so
Edward Thomson [Thu, 2 May 2013 19:58:40 +0000 (14:58 -0500)]
puns are not funny; type punning especially so

11 years agoUse assert for peel target type check
Russell Belfer [Thu, 2 May 2013 17:36:58 +0000 (10:36 -0700)]
Use assert for peel target type check

11 years agoMerge pull request #1535 from carlosmn/pack-threading
Vicent Martí [Thu, 2 May 2013 16:50:34 +0000 (09:50 -0700)]
Merge pull request #1535 from carlosmn/pack-threading

Switch to index_version as "git_pack_file is ready" flag

11 years agoSwitch to index_version as "git_pack_file is ready" flag
Carlos Martín Nieto [Thu, 2 May 2013 16:06:14 +0000 (18:06 +0200)]
Switch to index_version as "git_pack_file is ready" flag

We use p->index_map.data to check whether the struct has been set up
and all the information about the index is stored there. This variable
gets set up halfway through the setup process, however, and a thread
can come along and use fields that haven't been written to yet.

Crucially, pack_entry_find_offset() needs to read the index version
(which is written after index_map) to know the offset and stride
length to pass to sha1_entry_pos(). If these values are wrong,
assertions in it will fail, as it will be reading bogus data.

Make index_version the last field to be written and switch from using
p->index_map.data to p->index_version as "git_pack_file is ready" flag
as we can use it to know if every field has been written.

11 years agoMerge pull request #1531 from libgit2/jk/peeled-refs
Vicent Martí [Thu, 2 May 2013 16:21:46 +0000 (09:21 -0700)]
Merge pull request #1531 from libgit2/jk/peeled-refs

refdb_fs: do not require peeled packed refs to be tags

11 years agorefdb_fs: respect PEELING_STANDARD
Jeff King [Thu, 2 May 2013 16:06:46 +0000 (12:06 -0400)]
refdb_fs: respect PEELING_STANDARD

We only set our negative flag for PEELING_FULL; we can fall
back to the lesser PEELING_STANDARD if our ref is in the
refs/tags/ hierarchy.

11 years agorefdb_fs: Only strstr the traits line
Vicent Marti [Thu, 2 May 2013 15:48:49 +0000 (17:48 +0200)]
refdb_fs: Only strstr the traits line

11 years agorefdb_fs: Traits are always surrounded by spaces
Vicent Marti [Thu, 2 May 2013 15:42:09 +0000 (17:42 +0200)]
refdb_fs: Traits are always surrounded by spaces

This makes parsing easier! :p

11 years agorefdb_fs: store "cannot be peeled" flag for packed refs
Vicent Marti [Thu, 2 May 2013 15:29:58 +0000 (17:29 +0200)]
refdb_fs: store "cannot be peeled" flag for packed refs

Fixes #1532

11 years agorefdb_fs: implement the fully-peeled trait
Vicent Marti [Thu, 2 May 2013 15:17:46 +0000 (17:17 +0200)]
refdb_fs: implement the fully-peeled trait

11 years agoRevert "Protect sha1_entry_pos call with mutex"
Carlos Martín Nieto [Thu, 2 May 2013 15:14:05 +0000 (17:14 +0200)]
Revert "Protect sha1_entry_pos call with mutex"

This reverts commit 8c535f3f6879c6796d8107d7eb80dd8b2105621b.

11 years agorefdb_fs: do not require peeled packed refs to be tags
Jeff King [Thu, 2 May 2013 15:07:20 +0000 (11:07 -0400)]
refdb_fs: do not require peeled packed refs to be tags

Older versions of git would only write peeled entries for
items under refs/tags/. Newer versions will write them for
all refs, and we should be prepared to handle that.

11 years agoMerge pull request #1529 from arrbee/more-packfile-locking
Vicent Martí [Thu, 2 May 2013 10:37:28 +0000 (03:37 -0700)]
Merge pull request #1529 from arrbee/more-packfile-locking

More packfile locking

11 years agoProtect sha1_entry_pos call with mutex
Russell Belfer [Thu, 2 May 2013 10:34:56 +0000 (03:34 -0700)]
Protect sha1_entry_pos call with mutex

There is an occasional assertion failure in sha1_entry_pos from
pack_entry_find_index when running threaded.  Holding the mutex
around the code that grabs the index_map data and processes it
makes this assertion failure go away.

11 years agoFix some compile warnings and trailing whitespace
Russell Belfer [Thu, 2 May 2013 10:06:34 +0000 (03:06 -0700)]
Fix some compile warnings and trailing whitespace

11 years agoExtra threading tests
Russell Belfer [Thu, 2 May 2013 10:05:21 +0000 (03:05 -0700)]
Extra threading tests

We need to hammer the packfile open phase harder in the thread
tests, in addition to the cache API.

11 years agoAdd extra locking around packfile open
Russell Belfer [Thu, 2 May 2013 10:03:54 +0000 (03:03 -0700)]
Add extra locking around packfile open

We were still seeing a few issues in threaded access to packs.
This adds extra locks around the opening of the mwindow to
avoid a different race.

11 years agoclarify error propogation
Russell Belfer [Wed, 1 May 2013 22:55:54 +0000 (15:55 -0700)]
clarify error propogation

11 years agoclarify where error message is set
Russell Belfer [Wed, 1 May 2013 22:53:12 +0000 (15:53 -0700)]
clarify where error message is set

11 years agoClear error msg when we eat error silently
Russell Belfer [Wed, 1 May 2013 22:51:30 +0000 (15:51 -0700)]
Clear error msg when we eat error silently

11 years agoFix one error not reported in revparse
Russell Belfer [Wed, 1 May 2013 22:48:40 +0000 (15:48 -0700)]
Fix one error not reported in revparse

There are many paths through revparse that may return an error
code without reporting an error, I believe.  This fixes one of
them.  Because of the backtracking in revparse, it is pretty
complicated to fix the others.

11 years agominor missing error message
Russell Belfer [Wed, 1 May 2013 22:47:37 +0000 (15:47 -0700)]
minor missing error message

11 years agoFactor out some code that needed to clear errors
Russell Belfer [Wed, 1 May 2013 22:23:40 +0000 (15:23 -0700)]
Factor out some code that needed to clear errors

A number of places were looking up option config values and then
not clearing the error codes if the values were not found.  This
moves the repeated pattern into a shared routine and adds the
extra call to giterr_clear() when needed.

11 years agoError messages for a couple other boundary conditions
Russell Belfer [Wed, 1 May 2013 22:08:12 +0000 (15:08 -0700)]
Error messages for a couple other boundary conditions

11 years agoReport some errors returnable by push
Russell Belfer [Wed, 1 May 2013 22:01:47 +0000 (15:01 -0700)]
Report some errors returnable by push

11 years agoCatch some odd odb backend corner case errors
Russell Belfer [Wed, 1 May 2013 21:48:35 +0000 (14:48 -0700)]
Catch some odd odb backend corner case errors

There are some cases, particularly where no loaded ODB backends
support a particular operation, where we would return an error
code without having set an error.  This catches those cases and
reports that no ODB backends support the operation in question.

11 years agoReport a couple object error conditions
Russell Belfer [Wed, 1 May 2013 21:23:01 +0000 (14:23 -0700)]
Report a couple object error conditions

11 years agoReport errors finding notes
Russell Belfer [Wed, 1 May 2013 21:15:55 +0000 (14:15 -0700)]
Report errors finding notes

11 years agoSet error when no merge base is found
Russell Belfer [Wed, 1 May 2013 21:00:20 +0000 (14:00 -0700)]
Set error when no merge base is found

11 years agoReport stat error when checking if file modified
Russell Belfer [Wed, 1 May 2013 20:50:39 +0000 (13:50 -0700)]
Report stat error when checking if file modified

11 years agoMerge pull request #1527 from ethomson/checkout_allow_empty_dirs
Russell Belfer [Wed, 1 May 2013 20:47:00 +0000 (13:47 -0700)]
Merge pull request #1527 from ethomson/checkout_allow_empty_dirs

allow empty dirs to exist when doing checkout

11 years agoMore care reporting diff patch iteration errors
Russell Belfer [Wed, 1 May 2013 20:43:48 +0000 (13:43 -0700)]
More care reporting diff patch iteration errors

11 years agoMore care catching and setting config errors
Russell Belfer [Wed, 1 May 2013 20:38:56 +0000 (13:38 -0700)]
More care catching and setting config errors

11 years agorefdb: Properly load namespaces
Vicent Marti [Wed, 1 May 2013 16:21:10 +0000 (18:21 +0200)]
refdb: Properly load namespaces

11 years agoallow empty dirs to exist when doing checkout
Edward Thomson [Wed, 1 May 2013 14:50:40 +0000 (09:50 -0500)]
allow empty dirs to exist when doing checkout

11 years agomerge: Warning noise
Vicent Marti [Wed, 1 May 2013 13:31:23 +0000 (15:31 +0200)]
merge: Warning noise

11 years agorefdb: Proper namespace root
Vicent Marti [Wed, 1 May 2013 13:20:08 +0000 (15:20 +0200)]
refdb: Proper namespace root

11 years agoMerge pull request #1389 from ethomson/merge_trees
Vicent Martí [Wed, 1 May 2013 13:18:09 +0000 (06:18 -0700)]
Merge pull request #1389 from ethomson/merge_trees

Merge trees

11 years agoAdd error messages for failed submodule lookup
Russell Belfer [Wed, 1 May 2013 12:34:01 +0000 (05:34 -0700)]
Add error messages for failed submodule lookup

11 years agofix typo
Russell Belfer [Wed, 1 May 2013 12:32:10 +0000 (05:32 -0700)]
fix typo

11 years agoMake sure error messages get set
Russell Belfer [Wed, 1 May 2013 11:57:24 +0000 (04:57 -0700)]
Make sure error messages get set

11 years agoSimplify error reporting
Russell Belfer [Wed, 1 May 2013 11:57:05 +0000 (04:57 -0700)]
Simplify error reporting

11 years agoSet error message for branch functions
Russell Belfer [Wed, 1 May 2013 11:18:46 +0000 (04:18 -0700)]
Set error message for branch functions

There were a couple of places where an error was being returned
from branch related code but no error message was being set.

11 years agoMerge pull request #1523 from libgit2/vmg/namespaces
Vicent Martí [Wed, 1 May 2013 10:03:17 +0000 (03:03 -0700)]
Merge pull request #1523 from libgit2/vmg/namespaces

Namespace support

11 years agomove NAME and REUC extensions to sys/
Edward Thomson [Tue, 30 Apr 2013 22:33:11 +0000 (17:33 -0500)]
move NAME and REUC extensions to sys/

11 years agorenames!
Edward Thomson [Tue, 30 Apr 2013 19:56:41 +0000 (14:56 -0500)]
renames!

11 years agomerge!
Edward Thomson [Tue, 2 Apr 2013 03:16:21 +0000 (22:16 -0500)]
merge!

11 years agolol namespaces
Vicent Marti [Tue, 30 Apr 2013 19:02:13 +0000 (21:02 +0200)]
lol namespaces

11 years agoMerge pull request #1507 from arrbee/fix-look-inside-untracked-directory
Vicent Martí [Tue, 30 Apr 2013 17:29:46 +0000 (10:29 -0700)]
Merge pull request #1507 from arrbee/fix-look-inside-untracked-directory

Update diff handling of "untracked" directories

11 years agoFix some formatting inconsistency
Russell Belfer [Tue, 30 Apr 2013 11:13:39 +0000 (04:13 -0700)]
Fix some formatting inconsistency

11 years agoUpdate comment for clarity
Russell Belfer [Mon, 29 Apr 2013 13:21:56 +0000 (06:21 -0700)]
Update comment for clarity

11 years agoMore tests for diff untracked directories
Russell Belfer [Mon, 29 Apr 2013 09:57:01 +0000 (02:57 -0700)]
More tests for diff untracked directories

This includes more tests for various scenarios when diff includes
an untracked directory in the workdir with contents either ignored
or not.

11 years agoUpdate diff handling of untracked directories
Russell Belfer [Fri, 26 Apr 2013 22:35:47 +0000 (15:35 -0700)]
Update diff handling of untracked directories

When diff encounters an untracked directory, there was a shortcut
that it took which is not compatible with core git.  This makes
the default behavior no longer take that shortcut and instead look
inside the untracked directory to see if there are any untracked
files within it.  If there are not, then the directory is treated
as an ignore directory instead of an untracked directory.  This
has implications for the git_status APIs.

11 years agoReorganize diff code into functions
Russell Belfer [Thu, 25 Apr 2013 21:57:13 +0000 (14:57 -0700)]
Reorganize diff code into functions

In preparation for more changes to the internal diff logic, it
seemed wise to split the very large git_diff__from_iterators into
separate functions that handle the four main cases (unmatched old
item, unmatched new item, unmatched new directory, and matched
old and new items).  Hopefully this will keep the logic easier to
follow even as more cases have to be added to this code.

11 years agoobject: haha
Vicent Marti [Tue, 30 Apr 2013 11:19:02 +0000 (13:19 +0200)]
object: haha

11 years agoobject: Explicitly define helper API methods for all obj types
Vicent Marti [Tue, 30 Apr 2013 11:13:38 +0000 (13:13 +0200)]
object: Explicitly define helper API methods for all obj types

11 years agoMerge pull request #1518 from arrbee/export-oid-comparison
Vicent Martí [Tue, 30 Apr 2013 11:02:52 +0000 (04:02 -0700)]
Merge pull request #1518 from arrbee/export-oid-comparison

Remove most inlines from the public API

11 years agoMerge pull request #1520 from carlosmn/nth-refspec
Vicent Martí [Tue, 30 Apr 2013 10:29:48 +0000 (03:29 -0700)]
Merge pull request #1520 from carlosmn/nth-refspec

Add refspec list accessors

11 years agoMerge pull request #1522 from arrbee/repo-open-with-no-config
Vicent Martí [Tue, 30 Apr 2013 10:28:56 +0000 (03:28 -0700)]
Merge pull request #1522 from arrbee/repo-open-with-no-config

Catch issue in config set with no config file

11 years agoCatch issue in config set with no config file
Russell Belfer [Tue, 30 Apr 2013 10:15:45 +0000 (03:15 -0700)]
Catch issue in config set with no config file

This prevents a segfault when setting a value in the config of a
repository that doesn't have a config file.

11 years agoremote: fix a leak when dwim'ing refspecs
Carlos Martín Nieto [Tue, 30 Apr 2013 10:05:16 +0000 (12:05 +0200)]
remote: fix a leak when dwim'ing refspecs

11 years agoremote: add resfpec list accessors
Carlos Martín Nieto [Tue, 30 Apr 2013 09:18:16 +0000 (11:18 +0200)]
remote: add resfpec list accessors

Bring back a way of acessing the git_refspec* from a remote.

Closes #1514

11 years agorefspec: add direction accessor
Carlos Martín Nieto [Tue, 30 Apr 2013 08:55:17 +0000 (10:55 +0200)]
refspec: add direction accessor

11 years agoSome cleanups
Russell Belfer [Tue, 30 Apr 2013 01:20:58 +0000 (18:20 -0700)]
Some cleanups

Removed useless prototype and renamed object typecast functions
declaration macro.

11 years agoAdd new src/oid.h
Russell Belfer [Tue, 30 Apr 2013 01:15:43 +0000 (18:15 -0700)]
Add new src/oid.h

11 years agoStandardize cast versions of git_object accessors
Russell Belfer [Mon, 29 Apr 2013 21:22:06 +0000 (14:22 -0700)]
Standardize cast versions of git_object accessors

This removes the GIT_INLINE versions of the simple git_object
accessors and standardizes them with a helper macro in src/object.h
to build the function bodies.

11 years agoMake git_oid_cmp public and add git_oid__cmp
Russell Belfer [Mon, 29 Apr 2013 20:52:12 +0000 (13:52 -0700)]
Make git_oid_cmp public and add git_oid__cmp

11 years agoMerge pull request #1511 from carlosmn/refspec-shorthand
Vicent Martí [Mon, 29 Apr 2013 20:30:31 +0000 (13:30 -0700)]
Merge pull request #1511 from carlosmn/refspec-shorthand

dwim shorthand refspecs for fetch

11 years agoMerge pull request #1516 from ethomson/win32_alternate_nostat
Vicent Martí [Mon, 29 Apr 2013 17:21:03 +0000 (10:21 -0700)]
Merge pull request #1516 from ethomson/win32_alternate_nostat

don't use uninitialized struct stat in win32

11 years agodon't use uninitialized struct stat in win32
Edward Thomson [Mon, 29 Apr 2013 16:14:56 +0000 (11:14 -0500)]
don't use uninitialized struct stat in win32

11 years agoMerge pull request #1513 from ethomson/cmake
Vicent Martí [Mon, 29 Apr 2013 16:09:27 +0000 (09:09 -0700)]
Merge pull request #1513 from ethomson/cmake

cmake 2.6 parser bug workaround

11 years agocmake 2.6 parser bug workaround
Edward Thomson [Mon, 29 Apr 2013 16:00:05 +0000 (11:00 -0500)]
cmake 2.6 parser bug workaround

11 years agoAdd git_oid_strcmp and use it for git_oid_streq
Russell Belfer [Mon, 29 Apr 2013 15:59:46 +0000 (08:59 -0700)]
Add git_oid_strcmp and use it for git_oid_streq

Add a new git_oid_strcmp that compares a string OID with a hex
oid for sort order, and then reimplement git_oid_streq using it.
This actually should speed up git_oid_streq because it only reads
as far into the string as it needs to, whereas previously it would
convert the whole string into an OID and then use git_oid_cmp.

11 years agoFix fragile git_oid_ncmp
Russell Belfer [Mon, 29 Apr 2013 15:51:24 +0000 (08:51 -0700)]
Fix fragile git_oid_ncmp

git_oid_ncmp was making some assumptions about the length of
the data - this shifts the check to the top of the loop so it
will work more robustly, limits the max, and adds some tests
to verify the functionality.

11 years agoIntroduce git_oid_compare, an exported oid cmp
Russell Belfer [Mon, 29 Apr 2013 14:34:13 +0000 (07:34 -0700)]
Introduce git_oid_compare, an exported oid cmp

11 years agoMerge pull request #1512 from carlosmn/push-delete-only
Carlos Martín Nieto [Mon, 29 Apr 2013 11:13:42 +0000 (04:13 -0700)]
Merge pull request #1512 from carlosmn/push-delete-only

Fix push for delete-only and add travis rules to test it