Commit Graph

448 Commits

Author SHA1 Message Date
nulltoken
bf9e8cc86b branch: make git_branch_move() reference based 2012-07-24 16:09:47 +02:00
nulltoken
abee7bd36a branch: slight git_branch_create() doc improvement 2012-07-24 16:09:46 +02:00
nulltoken
88bcd5153f branch: introduce git_reference_is_branch() 2012-07-24 16:09:45 +02:00
nulltoken
eed378b669 branch: introduce git_branch_lookup() 2012-07-24 16:09:44 +02:00
nulltoken
b308c11e4e branch: change git_branch_create() to make it return a reference 2012-07-24 16:09:43 +02:00
Vicent Martí
5b78696334 Merge pull request #818 from nulltoken/rework
Revparse rework
2012-07-21 07:56:59 -07:00
nulltoken
db9be9457d object: introduce git_object_peel()
Partially fix #530
2012-07-17 20:32:40 +02:00
Vicent Marti
227f313119 attr: Rename the git_attr__ exports
Pevents collisions with the original libgit, which also exports those
exact symbols.

Fixes #822
2012-07-15 14:32:51 +02:00
Carlos Martín Nieto
1ebe432e2f commit: properly export git_commit_nth_gen_ancestor() 2012-07-12 20:33:30 +02:00
Vicent Martí
dd4345b424 Merge pull request #789 from carlosmn/odb-foreach
odb: add git_odb_foreach()
2012-07-12 09:42:54 -07:00
Vicent Martí
0cf6b2f29e Merge pull request #805 from nulltoken/fix/revwalk-email-parsing
Fix revwalk email parsing
2012-07-12 09:37:09 -07:00
Vicent Martí
db2d4061f6 Merge pull request #814 from nulltoken/topic/revparse-refac
Revparse refactoring: a start
2012-07-12 09:35:35 -07:00
Vicent Martí
48bcf81dd2 Merge pull request #812 from arrbee/assorted-tweaks
Assorted goodies
2012-07-12 09:32:44 -07:00
nulltoken
84f18e3587 refs: introduce git_reference_remote_tracking_from_branch() 2012-07-12 01:06:13 +02:00
nulltoken
b1aca6eae0 commit: introduce git_commit_nth_gen_ancestor() 2012-07-12 01:06:11 +02:00
nulltoken
8aedf1d558 signature: prevent angle bracket usage in identity 2012-07-11 20:40:13 +02:00
Vicent Martí
a13a30ac30 Merge pull request #801 from nulltoken/fix/ref-renaming
refs and revparse love <3
2012-07-11 05:29:51 -07:00
Russell Belfer
991a56c704 Add flag to write gitlink on setting repo workdir
This added a flag to the `git_repository_set_workdir()` function
that enables generation of a `.git` gitlink file that links the
new workdir to the parent repository.  Essentially, the flag tells
the function to write out the changes to disk to permanently set
the workdir of the repository to the new path.

If you pass this flag as true, then setting the workdir to something
other than the default workdir (i.e. the parent of the .git repo
directory), will create a plain file named ".git" with the standard
gitlink contents "gitdir: <repo-path>", and also update the
"core.worktree" and "core.bare" config values.

Setting the workdir to the default repo workdir will clear the
core.worktree flag (but still permanently set core.bare to false).

BTW, the libgit2 API does not currently provide a function for
clearing the workdir and converting a non-bare repo into a bare one.
2012-07-10 23:19:47 -07:00
Russell Belfer
b3ff1dab31 Adding git_config_foreach_match() iteration fn
Adding a new config iteration function that let's you iterate
over just the config entries that match a particular regular
expression.  The old foreach becomes a simple use of this with
an empty pattern.

This also fixes an apparent bug in the existing `git_config_foreach`
where returning a non-zero value from the iteration callback was
not correctly aborting the iteration and the returned value was
not being propogated back to the caller of foreach.

Added to tests to cover all these changes.
2012-07-10 23:19:47 -07:00
Russell Belfer
4d3a7b7846 Merge pull request #793 from libgit2/tree-entry-by-path
Bring back `entry_bypath`
2012-07-10 21:45:16 -07:00
Russell Belfer
19017a24e3 Merge pull request #797 from yorah/fix/inter-hunk-context
diff: make inter-hunk-context default value git-compliant
2012-07-10 16:24:17 -07:00
nulltoken
33c3370700 refs: deploy git_reference_has_log() 2012-07-07 12:15:29 +02:00
nulltoken
75261421ec refs: add git_reference_has_log() 2012-07-07 12:15:28 +02:00
Kevin Sawicki
4ea7c8c666 Replace incorrect 'it' with 'if' in documentation 2012-07-03 12:35:33 -07:00
Carlos Martín Nieto
521aedad30 odb: add git_odb_foreach()
Go through each backend and list every objects that exists in
them. This allows fsck-like uses.
2012-07-03 12:50:51 +02:00
yorah
29f9186d1b diff: make inter-hunk-context default value git-compliant
Default in git core is 0, not 3
2012-07-02 17:27:49 +02:00
Vicent Marti
46ea40d995 tree: Rename entry_copy to entry_dup 2012-06-29 17:08:36 +02:00
Vicent Marti
0e2fcca850 tree: Bring back entry_bypath
Smaller, simpler, faster.
2012-06-29 02:21:12 +02:00
Carlos Martín Nieto
371599576a indexer: don't use '/objects/pack/' unconditionally
Not everyone who indexes a packfile wants to put it in the standard
git repository location.
2012-06-28 10:24:03 +02:00
Vicent Martí
c6713398ba Merge pull request #785 from nulltoken/topic/refs-fromglob
Topic/refs fromglob
2012-06-25 23:27:35 -07:00
nulltoken
527ed55448 references: introduce git_reference_foreach_glob() 2012-06-22 21:40:24 +02:00
Vicent Marti
798e4d53dc amigaos: Cleanup 2012-06-22 21:25:17 +02:00
Vicent Marti
2ae052d1b1 Merge branch 'pull-req' of https://github.com/chris-y/libgit2 into amigaos 2012-06-22 20:48:50 +02:00
nulltoken
d4827081ea branch: drop git_branch_list() 2012-06-21 18:51:32 +02:00
nulltoken
a8fd805e2f branch: add git_branch_foreach() 2012-06-21 18:51:27 +02:00
Vicent Martí
c3ce8d0c9a Merge pull request #775 from arrbee/fix-index-filemodes
Make index add/append support core.filemode flag
2012-06-19 15:17:35 -07:00
Russell Belfer
77d65af439 Nicer constant 2012-06-19 15:16:38 -07:00
Russell Belfer
da825c92d9 Make index add/append support core.filemode flag
This fixes git_index_add and git_index_append to behave more like
core git, preserving old filemode data in the index when adding
and/or appending with core.filemode = false.

This also has placeholder support for core.symlinks and
core.ignorecase, but those flags are not implemented (well,
symlinks has partial support for preserving mode information in
the same way that git does, but it isn't tested).
2012-06-19 14:27:02 -07:00
nulltoken
743a4b3bdd message: Expose git_message_prettify()
git_commit() and git_tag() no longer prettify the
message by default. This has to be taken care of
by the caller.

This has the nice side effect of putting the
caller in position to actually choose to strip
the comments or not.
2012-06-19 10:02:22 +02:00
Vicent Martí
31eed56b9e Merge pull request #753 from nulltoken/topic/merge-base-many
Expose git_merge_base_many()
2012-06-18 17:36:14 -07:00
Chris Young
a8df98c6fb Updates from comments on OS4 compatibility pull request http://github.com/libgit2/libgit2/pull/766 2012-06-14 18:57:24 +01:00
Chris Young
a21bb1aa33 Merge remote-tracking branch 'source/development' into development 2012-06-13 23:28:51 +01:00
Carlos Martín Nieto
14ebe51832 Expose git_refspec_parse()
This function has been available for some time, but never in a
header. Expose it so we can use it from outside the library.
2012-06-12 15:24:33 +02:00
Chris Young
327fb51cec Fix gethostbyname compatibility 2012-06-09 18:13:07 +01:00
Russell Belfer
145e696b49 Minor fixes, cleanups, and clarifications
There are three actual changes in this commit:

1. When the trailing newline of a file is removed in a diff, the
   change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
   to the callback.  Previously, the `ADD_EOFNL` constant was given
   which was just an error in my understanding of when the various
   circumstances arose.  `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
   should never be generated.  A new newline is simply an `ADD`.
2. Rewrote the `diff_delta__merge_like_cgit` function that contains
   the core logic of the `git_diff_merge` implementation.  The new
   version doesn't actually have significantly different behavior,
   but the logic should be much more obvious, I think.
3. Fixed a bug in `git_diff_merge` where it freed a string pool
   while some of the string data was still in use.  This led to
   `git_diff_print_patch` accessing memory that had been freed.

The rest of this commit contains improved documentation in `diff.h`
to make the behavior and the equivalencies with core git clearer,
and a bunch of new tests to cover the various cases, oh and a minor
simplification of `examples/diff.c`.
2012-06-08 12:11:13 -07:00
Russell Belfer
0abd724454 Fix filemode comparison in diffs
File modes were both not being ignored properly on platforms
where they should be ignored, nor be diffed consistently on
platforms where they are supported.

This change adds a number of diff and status filemode change
tests.  This also makes sure that filemode-only changes are
included in the diff output when they occur and that filemode
changes are ignored successfully when core.filemode is false.

There is no code that automatically toggles core.filemode
based on the capabilities of the current platform, so the user
still needs to be careful in their .git/config file.
2012-06-08 12:09:10 -07:00
Chris Young
fa56478fb8 Generic needs compat files 2012-06-08 19:15:11 +01:00
Chris Young
aa5a92d121 OS4 compatibility 2012-06-08 18:57:35 +01:00
Chris Young
519757279e Fix double-defines when using GIT_OLD_ERRORS 2012-06-07 23:13:39 +01:00
Chris Young
0f5e1f3b68 Network byte order is big-endian - the way it should be :) 2012-06-07 21:56:19 +01:00