Commit Graph

962 Commits

Author SHA1 Message Date
Ben Straub
e167ec1897 Merge pull request #1597 from zodiac/patch-1
define "long name" in git_reference_name_to_id
2013-05-21 08:09:17 -07:00
Carlos Martín Nieto
fc74343ff4 refs: export the glob iterator 2013-05-21 16:51:50 +02:00
Li Xuanji
e069478edc define "long name" in git_reference_name_to_id 2013-05-21 21:35:58 +08:00
nulltoken
e841c533d7 revparse: Introduce git_revparse_ext()
Expose a way to retrieve, along with the target git_object, the reference
pointed at by some revparse expression (`@{<-n>}` or
`<branchname>@{upstream}` syntax).
2013-05-16 21:43:24 +02:00
Vicent Martí
e3107e0ee1 Merge pull request #1558 from bmorganpa/ssh_transport
SSH Transport
2013-05-16 11:35:02 -07:00
Russell Belfer
58206c9ae7 Add cat-file example and increase const use in API
This adds an example implementation that emulates git cat-file.
It is a convenient and relatively simple example of getting data
out of a repository.

Implementing this also revealed that there are a number of APIs
that are still not using const pointers to objects that really
ought to be.  The main cause of this is that `git_vector_bsearch`
may need to call `git_vector_sort` before doing the search, so a
const pointer to the vector is not allowed.  However, for tree
objects, with a little care, we can ensure that the vector of
tree entries is always sorted and allow lookups to take a const
pointer.  Also, the missing const in commit objects just looks
like an oversight.
2013-05-16 10:38:27 -07:00
Russell Belfer
89251b283b Update index.h docs
Move the git_index_entry to the very top, since it provides the
main structure that needs to be understood by the reader, then
move the bitmasks for the flags and the flags_extended under that
since they are details for looking at particular fields of the
structure.
2013-05-15 16:25:11 -07:00
Russell Belfer
96c01991c1 Remove entry dup/free functions and fix comments
This removes the functions to duplicate and free copies of a
git_index_entry and updates the comments to explain that you
should just use the public definition of the struct as needed.
2013-05-15 16:13:04 -07:00
Russell Belfer
797dfb28fe Add APIs to dup and free git_index_entrys
This adds git_index_entry_dup to make a copy of an existing entry
and git_index_entry_free to release the memory of the copy.  It
also updates the documentation for git_index_get_bypath and
git_index_get_byindex to make it clear that the returned structure
should *not* be modified.
2013-05-15 16:11:31 -07:00
Russell Belfer
487884a930 Improve docs for git_index_entry flag masks
The constants for extracting data from git_index_entry flags and
flags_extended are not named in a way that makes it easy to know
where to use each one.  This improves the docs for the flags (and
slightly reorganizes them), so it should be more obvious.
2013-05-15 16:11:31 -07:00
Vicent Martí
7159620044 Merge pull request #1588 from arrbee/fixes-for-checkout-and-diff
Bug fixes for checkout and diff
2013-05-15 15:47:46 -07:00
Russell Belfer
dcb0f7c061 Fix checkout of submodules with no .gitmodules
It is possible for there to be a submodule in a repository with
no .gitmodules file (for example, if the user forgot to commit
the .gitmodules file).  In this case, core Git will just create
an empty directory as a placeholder for the submodule but
otherwise ignore it.  We were generating an error and stopping
the checkout.  This makes our behavior match that of core git.
2013-05-15 14:54:02 -07:00
nulltoken
1fed6b07f0 Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
Linquize
0cb16fe924 Unify whitespaces to tabs 2013-05-15 20:26:55 +08:00
Edward Thomson
b6cc559a78 Merge pull request #1385 from carlosmn/refs-iter
Introduce a refs iterator
2013-05-11 02:42:49 -07:00
Carlos Martín Nieto
c58cac12c2 Introduce a glob-filtering iterator
If the backend doesn't provide support for it, the matching is done in
refdb on top of a normal iterator.
2013-05-11 11:20:38 +02:00
Carlos Martín Nieto
2b562c3a1e refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.

As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
2013-05-11 11:20:38 +02:00
Carlos Martín Nieto
4def7035ca refs: introduce an iterator
This allows us to get a list of reference names in a loop instead of callbacks.
2013-05-11 11:20:37 +02:00
Brad Morgan
89ea0e5181 Removed ifdef 2013-05-10 09:40:14 -04:00
Brad Morgan
b4d81a00bf Moved libssh2 sign callback into typedef 2013-05-09 17:40:21 -04:00
Russell Belfer
3d1c9f612d Fix git_repository_message docs
This clarifies the docs for git_repository_message and also adds
to the tests to explicitly check NUL termination of data when the
output buffer is smaller than the message size.  There is a minor
behavior change so that a non-NULL output buffer will always be
NUL terminated (at length zero) if an error occurs.
2013-05-09 06:45:06 -07:00
Vicent Martí
503dd0f3c4 Merge pull request #1560 from carlosmn/ref-dwim
Expose git_reference_dwim
2013-05-09 05:43:25 -07:00
Vicent Martí
af795759a7 Merge pull request #1552 from carlosmn/config-helpers
Config helpers for global/xdg config files
2013-05-07 15:09:11 -07:00
Carlos Martín Nieto
98d633cccf Expose git_reference_dwim
Extract this function out of the rev-parse code to be able to DWIM a
reference instead of its target.
2013-05-07 23:34:48 +02:00
Carlos Martín Nieto
5d8318875f config: convenience function to open global/xdg
The rules for which one to open is a bit silly, so let's make it
easier for our users.
2013-05-07 21:42:56 +02:00
Brad Morgan
4ca3d6d28f Added ifdef 2013-05-07 14:37:15 -04:00
Brad Morgan
00e43380a0 Merge remote-tracking branch 'origin/development' into ssh_transport 2013-05-07 14:30:35 -04:00
Brad Morgan
574b86b722 Fixed compilation issues when libssh2 is missing 2013-05-07 13:56:34 -04:00
Brad Morgan
c36565c0ee Added SSH public key authentication 2013-05-07 13:45:31 -04:00
Vicent Martí
33665410d6 Merge pull request #1556 from arrbee/diff-patch-fixes
Diff patch bug fixes
2013-05-07 08:00:44 -07:00
Russell Belfer
d63eec6946 Improve diff function docs 2013-05-07 04:44:08 -07:00
Russell Belfer
e35e2684f6 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.
2013-05-07 04:32:17 -07:00
J. David Ibáñez
6e8659969a Add git_commit_owner to the public interface
Just like git_tree_owner, etc.
2013-05-07 07:33:35 +02:00
Vicent Martí
450a78bf07 Merge pull request #1545 from ethomson/checkout_dirs_in_use
allow checkout to proceed when a dir to be removed is in use (win32)
2013-05-06 06:33:02 -07:00
Nikolai Vladimirov
72662202ac branch.h: fix typo in docs 2013-05-06 15:31:26 +03:00
nulltoken
467cbec73d commit: make create_from_oids() accept plain oid 2013-05-05 16:48:34 +02:00
Brad Morgan
f7158cd79b Push working over ssh 2013-05-04 11:28:20 -04:00
Edward Thomson
e09d18eed6 allow checkout to proceed when a dir to be removed is in use (win32) 2013-05-03 18:54:47 -05:00
Brad Morgan
297758dce3 Added ssh transport file 2013-05-03 10:37:33 -04:00
Vicent Martí
758e50c51e Merge pull request #1389 from ethomson/merge_trees
Merge trees
2013-05-01 06:18:09 -07:00
Vicent Martí
cfcdbc100a Merge pull request #1523 from libgit2/vmg/namespaces
Namespace support
2013-05-01 03:03:17 -07:00
Edward Thomson
75d1c8c664 move NAME and REUC extensions to sys/ 2013-04-30 17:33:11 -05:00
Edward Thomson
0462fba538 renames! 2013-04-30 16:01:11 -05:00
Edward Thomson
bec65a5e99 merge! 2013-04-30 15:31:31 -05:00
Vicent Marti
bade51948c lol namespaces 2013-04-30 21:02:13 +02:00
Russell Belfer
61c00541ac Update comment for clarity 2013-04-30 04:25:56 -07:00
Russell Belfer
e26b14c034 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.
2013-04-30 04:25:56 -07:00
Vicent Marti
0b726701f3 object: Explicitly define helper API methods for all obj types 2013-04-30 13:13:38 +02:00
Vicent Martí
cd2ed9f0cc Merge pull request #1518 from arrbee/export-oid-comparison
Remove most inlines from the public API
2013-04-30 04:02:52 -07:00
Carlos Martín Nieto
1ffd0806f4 remote: add resfpec list accessors
Bring back a way of acessing the git_refspec* from a remote.

Closes #1514
2013-04-30 12:04:59 +02:00