On Sun, Jun 14, 2015 at 11:43 AM, Christian Couder
wrote:
> On Sat, Jun 13, 2015 at 10:18 PM, Karthik Nayak wrote:
>> Add a macro for using the '--contains' option in parse-options.h
>> also include an optional '--with' option macro which performs the
>> same action as '--contains'.
>>
>> Make ta
On Sun, Jun 14, 2015 at 11:19 AM, Christian Couder
wrote:
> On Sat, Jun 13, 2015 at 10:18 PM, Karthik Nayak wrote:
>>
>> diff --git a/ref-filter.h b/ref-filter.h
>> index c2856b8..799e118 100644
>> --- a/ref-filter.h
>> +++ b/ref-filter.h
>> @@ -50,6 +50,18 @@ struct ref_filter_cbdata {
>>
On Sat, Jun 13, 2015 at 10:18 PM, Karthik Nayak wrote:
> Add a macro for using the '--contains' option in parse-options.h
> also include an optional '--with' option macro which performs the
> same action as '--contains'.
>
> Make tag.c use this new macro
>
> Mentored-by: Christian Couder
> Mentor
On Sat, Jun 13, 2015 at 10:18 PM, Karthik Nayak wrote:
>
> diff --git a/ref-filter.h b/ref-filter.h
> index c2856b8..799e118 100644
> --- a/ref-filter.h
> +++ b/ref-filter.h
> @@ -50,6 +50,18 @@ struct ref_filter_cbdata {
> struct ref_filter *filter;
> };
>
> +/* Macros for checking --me
On Tue, Jun 9, 2015 at 2:24 PM, Erik Elfström wrote:
> read_gitfile_gently will allocate a buffer to fit the entire file that
> should be read. Add a sanity check of the file size before opening to
> avoid allocating a potentially huge amount of memory if we come across
> a large file that someone
On Sun, Jun 14, 2015 at 12:18 AM, Sami Boukortt wrote:
> git: pathspec.c:317: prefix_pathspec: Assertion `item->nowildcard_len
> <= item->len && item->prefix <= item->len' failed.
Known issue, but no one stepped up to fix it yet
http://thread.gmane.org/gmane.comp.version-control.git/267095
--
D
Matthieu Moy writes:
> Remi Galan Alfonso writes:
>
> > It is mainly because here the SHA-1 is a long one (40 chars)
>
> OK, but then the minimum would be to add a comment saying that.
>
> Now, this makes me wonder why you are doing the check after the sha1
> expansion and not before. Also, wh
Convert the parse_fetch function to use struct object_id. Remove the
strlen check as get_oid_hex will fail safely on receiving a too-short
NUL-terminated string.
Signed-off-by: brian m. carlson
---
remote-curl.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/re
Convert several internal functions in refs.c to use struct object_id,
and use the GIT_SHA1_HEXSZ constants in parse_ref_line.
Signed-off-by: brian m. carlson
---
refs.c | 104 -
1 file changed, 52 insertions(+), 52 deletions(-)
dif
This is another series of conversions to struct object_id.
This series converts more of the refs code and struct object to use
struct object_id. It introduces an additional helper function,
has_object_file, which is the equivalent of has_sha1_file. The name was
chosen to be slightly more logical
Convert ref_newer and its caller to use struct object_id instead of
unsigned char *.
Signed-off-by: brian m. carlson
---
builtin/remote.c | 2 +-
http-push.c | 4 ++--
remote.c | 8
remote.h | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/buil
Use struct object_id in three fields in struct ref and convert all the
necessary places that use it.
Signed-off-by: brian m. carlson
---
builtin/clone.c| 16 +++---
builtin/fetch-pack.c | 4 ++--
builtin/fetch.c| 50 +--
builtin/
Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.
Signed-off-by: brian m. carlson
---
cache.h | 3 +++
sha1_file.c | 5 +
2 files changed, 8 insertions(+)
diff --git a/cache.h b/cache.h
index 571c98f..fa1f067 100644
--- a/cache.h
+++ b/cache.h
@@ -9
Convert several unsigned char arrays to use struct object_id instead,
and change hard-coded 40-based constants to use GIT_SHA1_HEXSZ as well.
Signed-off-by: brian m. carlson
---
remote.c | 64
1 file changed, 32 insertions(+), 32 d
Signed-off-by: brian m. carlson
---
transport-helper.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 4ca3e80..1f28b82 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -877,13 +877,13 @@ static int push_refs_wit
Replace an unsigned char array with struct object_id and express several
hard-coded constants in terms of GIT_SHA1_HEXSZ.
Signed-off-by: brian m. carlson
---
connect.c | 22 --
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/connect.c b/connect.c
index f8b10eb
Convert this function to use struct object_id. Express several
hardcoded constants in terms of GIT_SHA1_HEXSZ.
Signed-off-by: brian m. carlson
---
builtin/fetch-pack.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
in
Hello All,
As part of GSoC I'm working on the Unification of 'for-each-ref', 'tag -l'
and 'branch -l'. I will update the list on my weekly progress in an effort
to keep everyone updated.
Current Progress:
Currently I have two patches for review on the mailing list.
1. [PATCH v8 0/11] Create ref-
Signed-off-by: Karsten Blees
---
Enabling nanosecond file times was recently discussed on the libgit2 project, so
I thought its time to fix the nanosecond issue on Linux. Don't know yet if the
patch will be accepted (and in which kernel version).
Considering that nanosecond file times are still b
As a "distributed" VCS, git should better define the encodings of its core
textual data structures, in particular those that are part of the network
protocol.
That git is encoding agnostic is only really true for blob objects. E.g.
the 'non-NUL bytes' requirement of tree and commit objects exclude
Date: Wed, 6 Aug 2014 20:43:46 +0200
The number of loose objects at which git-gui shows a gc warning has
historically been hardcoded to ~2000, or ~200 on Windows. The warning can
only be disabled completely via gui.gcwarning=false.
Especially on Windows, the hardcoded threshold is so ridiculously
Add the '--merged' and '--no-merged' options provided by 'ref-filter'.
The '--merged' option lets the user to only list refs merged into the
named commit. The '--no-merged' option lets the user to only list refs
not merged into the named commit.
Add documentation and tests for the same.
Based-on-
Add the '--contains' option provided by 'ref-filter'. The '--contains'
option lists only refs which are contain the mentioned commit (HEAD if
no commit is explicitly given).
Add documentation and tests for the same.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik
Rename parse_opt_with_commit() to parse_opt_commit_object_name()
to show that it can be used to obtain a list of commits and is
not constricted to usage of '--contains' option.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/branch.c | 4 ++--
'tag -l' and 'branch -l' have two different ways of finding
out if a certain ref contains a commit. Implement both these
methods in ref-filter and give the caller of ref-filter API
the option to pick which implementation to be used.
'branch -l' uses 'is_descendant_of()' from commit.c which is
left
Add a macro for using the '--contains' option in parse-options.h
also include an optional '--with' option macro which performs the
same action as '--contains'.
Make tag.c use this new macro
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/tag.c
In 'branch -l' we have '--merged' option which only lists refs (branches)
merged into the named commit and '--no-merged' option which only lists
refs (branches) not merged into the named commit. Implement these two
options in ref-filter.{c,h} so that other commands can benefit from this.
Based-on-
Add 'parse_opt_merge_filter()' to parse '--merged' and '--no-merged'
options and write MACROS for the same.
This is copied from 'builtin/branch.c' which will eventually be removed
when we port 'branch.c' to use ref-filter APIs.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored
Add tests for for-each-ref which utilizes the ref-filter APIs.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
t/t6301-for-each-ref-filter.sh | 35 +++
1 file changed, 35 insertions(+)
creat
Add the '--points-at' option provided by 'ref-filter'. The
option lets the user to pick only refs which point to a particular
commit.
Add documentation and tests for the same.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
Rename 'parse_opt_points_at()' to 'parse_opt_object_name()' and
move it from 'tag.c' to 'parse-options'. This now acts as a common
parse_opt function which accepts an objectname and stores it into
a sha1_array.
Based-on-patch-by: Jeff King
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
In 'tag -l' we have '--points-at' option which lets users
list only tags which point to a particular commit. Implement
this option in 'ref-filter.{c,h}' so that other commands can
benefit from this.
This is duplicated from tag.c, we will eventually remove that
when we port tag.c to use ref-filter
This is continuation of the patch series 'Create ref-filter from for-each-ref'
found at : http://article.gmane.org/gmane.comp.version-control.git/271563
The previous version of this series can be found at :
http://www.mail-archive.com/git%40vger.kernel.org/msg70929.html
Changes made:
* Added test
Rename 'refinfo' to 'ref_array_item' as a preparatory step for
introduction of new structures in the forthcoming patch.
Re-order the fields in 'ref_array_item' so that refname can be
eventually converted to a FLEX_ARRAY.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Kar
Move most of the code from 'for-each-ref' to 'ref-filter' to make
it publicly available to other commands, this is to unify the code
of 'tag -l', 'branch -l' and 'for-each-ref' so that they can share
their implementations with each other.
Add 'ref-filter' to the Makefile, this completes the moveme
Introduce and implement 'ref_array_clear()' which will free
all allocated memory for 'ref_array'.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/for-each-ref.c | 21 +
1 file changed, 21 insertions(+)
diff --git a/builtin/f
Introduce 'ref_filter_cbdata' which will hold 'ref_filter'
(conditions to filter the refs on) and 'ref_array' (the array
of ref_array_items). Modify the code to use these new structures.
This is a preparatory patch to eventually move code from 'for-each-ref'
to 'ref-filter' and make it publicly av
This would remove the need of using a pointer to store refname.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
ref-filter.c | 7 ---
ref-filter.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
ind
Introduce filter_refs() which will act as an API for filtering
a set of refs. Based on the type of refs the user has requested,
we iterate through those refs and apply filters as per the
given ref_filter structure and finally store the filtered refs
in the ref_array structure.
Currently this will
Rename all the variables called sort to sorting to match the
function/structure name changes made in the previous patch.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/for-each-ref.c | 28 ++--
1 file changed, 14 inserti
This is step one of creating a common library for 'for-each-ref',
'branch -l' and 'tag -l'. This creates a header file with the
functions and data structures that ref-filter will provide.
We move the data structures created in for-each-ref to this header
file.
Mentored-by: Christian Couder
Mentor
Rename some of the functions and make them publicly available.
This is a preparatory step for moving code from 'for-each-ref'
to 'ref-filter' to make meaningful, targeted services available to
other commands via public APIs.
Functions renamed are:
parse_atom()-> parse_ref_filter_a
Extract two helper functions out of grab_single_ref(). Firstly,
new_refinfo() which is used to allocate memory for a new refinfo
structure and copy the objectname, refname and flag to it.
Secondly, match_name_as_path() which when given an array of patterns
and the refname checks if the refname matc
In 'grab_single_ref()' remove the extra count variable 'cnt' and
use the variable 'grab_cnt' of structure 'grab_ref_cbdata' directly
instead.
Mentored-by: Christian Couder
Mentored-by: Matthieu Moy
Signed-off-by: Karthik Nayak
---
builtin/for-each-ref.c | 7 ++-
1 file changed, 2 insertion
The previous version of the patch can be found at :
http://thread.gmane.org/gmane.comp.version-control.git/271423
Changes :
* Removed an unnecessary commit (v7 3/12)
* Change a comment in 01/11 (v8)
Total changes :
Makefile |1 +
builtin/for-each-ref.c | 1108
+++--
Hi,
I can reliably trigger a failed assertion in Git 2.4.3 by performing
the following steps:
mkdir a; cd a
git init
touch a.txt
git add a.txt
git commit -m 'a'
cd ..
mkdir b; cd b
git init
git submodule add ../a
cd a
rm -fr .git
git add .
This results in:
git: pathspec.c:317: prefix_pathspec:
Difference between v4 and v5 of this patch:
- added documention in Documentation/config.txt
- renamed the new auto-rebase w/ config test to be less inaccurate
Apologies for this, I should have caught these before.
Michael Rappazzo (1):
git-rebase--interactive.sh: add config option for cus
A config option 'rebase.instructionFormat' can override the
default 'oneline' format of the rebase instruction list.
Since the list is parsed using the left, right or boundary mark plus
the sha1, they are prepended to the instruction format.
Signed-off-by: Michael Rappazzo
---
Documentation/con
On Sat, Jun 13, 2015 at 10:45:29AM +0200, Michael Haggerty wrote:
> In the same email where I made those design suggestions, I also I
> pointed out a bug in the implementation of parse_oid_hex(). Maybe that
> is the reason for the test failures.
It probably is, although I either botched a conversi
"git clone" uses shortcuts when creating the initial set of
references:
* It writes them directly to packed-refs.
* It doesn't lock the individual references (though it does lock the
packed-refs file).
* It doesn't check for refname conflicts between two new references or
between one new ref
It is no longer called from outside of the refs module. Also move its
docstring and change it to imperative voice.
Signed-off-by: Michael Haggerty
---
refs.c | 9 -
refs.h | 11 ---
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/refs.c b/refs.c
index 5386077..83
This is v2 of this patch series. I think I have addressed all of the
feedback from v1 [1]. Thanks to Stefan, Peff and Junio for their
feedback.
Changes since v1:
* Change docstring for delete_ref() and a comment within the function
definition.
* Squash together two commits dealing with the err
Change the error message from
Could not remove branch %s
to
could not remove reference %s
* s/branch/reference/. This change makes sense even for the existing
caller, which uses the function to delete remote-tracking
branches.
* Convert it to lower case, as per our usual convention
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index f4a6ec9..53b8e13 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -756,8 +756,7 @@ static int remove_branches(struct string_l
The following functions are no longer used from outside the refs
module:
* lock_packed_refs()
* add_packed_ref()
* commit_packed_refs()
* rollback_packed_refs()
So make these functions private.
This is an important step, because it means that nobody outside of the
refs module needs to know the d
Error out if the ref_transaction includes more than one update for any
refname.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/refs.c b/refs.c
index a715524..dfe9090 100644
--- a/refs.c
+++ b/refs.c
@@ -4068,12 +4068,22 @@ int initial_
Some functions from the refs module were still declared in cache.h.
Move them to refs.h.
Add some parameter names where they were missing.
Signed-off-by: Michael Haggerty
---
archive.c | 1 +
builtin/blame.c | 1 +
builtin/fast-export.c | 1 +
builtin/fmt-merge-msg
This will result in errors being emitted for references that can't be
deleted, but that is a good thing.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index c8dc724..cc3c741
In initial_ref_transaction_commit(), check for D/F conflicts (i.e.,
the type of conflict that exists between "refs/foo" and
"refs/foo/bar") among the references being created and between the
references being created and any hypothetical existing references.
Ideally, there shouldn't *be* any existi
Also
* Add a docstring
* Rename the second parameter to "old_sha1", to be consistent with the
convention used elsewhere in the refs module
Signed-off-by: Michael Haggerty
---
cache.h | 2 --
refs.c | 5 +++--
refs.h | 10 ++
3 files changed, 13 insertions(+), 4 deletions(-)
diff
Move the function remove_branches() from builtin/remote.c to refs.c,
rename it to delete_refs(), and make it public.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 21 +
refs.c | 19 +++
refs.h | 7 +++
3 files changed, 27 inse
delete_ref() uses a different convention for its old_sha1 parameter
than, say, ref_transaction_delete(): NULL_SHA1 means not to check the
old value. Make this fact a little bit clearer in the code by handling
it in explicit, commented code rather than burying it in a conditional
expression.
Signed
On 06/09/2015 06:42 PM, Stefan Beller wrote:
> On Tue, Jun 9, 2015 at 3:10 AM, Michael Haggerty wrote:
>> In set notation,
>>
>> "non-NULL" =
>> "non-NULL and not NULL_SHA1" ∪
>> "non-NULL and equal to NULL_SHA1"
>>
>> The latter two are *not* treated the same, so I don't see h
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 06/13/2015 12:27 AM, brian m. carlson wrote:
> On Fri, Jun 12, 2015 at 03:14:25PM -0700, Junio C Hamano wrote:
>> "brian m. carlson" writes:
>>
>>> While I did run the tests between each commit, I hadn't noticed
>>> they were failing because I don
64 matches
Mail list logo