On Fri, Mar 24, 2017 at 11:37:54PM -0700, Junio C Hamano wrote:
> The hash that names a packfile is constructed by sorting all the
> names of the objects contained in the packfile and running SHA-1
> hash over it. I think this MUST be hashed with collision-attack
> detection. A malicious site ca
On Sat, Mar 25, 2017 at 10:52:47PM +0100, Ævar Arnfjörð Bjarmason wrote:
> > If we want to consider performance-related concerns, I think the easier
> > solution is using Nettle, which is LGPL 2.1. Considering that the
> > current opinions for a new hash function are moving in the direction of
>
On Sat, Mar 25, 2017 at 2:30 PM, Dennis Kaarsemaker
wrote:
>
>> - does this code do a reasonable thing when the path is a symbolic
>>link that points at a directory? what does it mean to grab
>>st.st_size for such a thing (and then go on to open() and xmmap()
>>it)?
>
> No, it does s
Hi there. First of all, I'd like to thank all of the support up to now
with my microproject :). Here's a first draft of my proposal for
Google Summer of Code '17, based on the "Convert scripts to builtins"
idea. Please let me know what you think.
---
SYNOPSIS
There are many advantages to converti
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.h | 4 ++--
t/t1405-main-ref-store.sh | 6 ++
t/t1406-submodule-ref-store.sh | 6 ++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/refs.h b/refs.h
index 1a07f9d86f..49e97d7d5f 100644
--- a/refs.h
+
A small step towards making files-backend works as a non-main ref store
using the newly added store-aware API.
For the record, `join` and `nm` on refs.o and files-backend.o tell me
that files-backend no longer uses functions that defaults to
get_main_ref_store().
I'm not yet comfortable at the id
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Makefile| 1 +
t/helper/.gitignore | 1 +
t/helper/test-ref-store.c (new) | 277
3 files changed, 279 insertions(+)
create mode 100644 t/helper/test-ref-store.c
diff --git a/
Signed-off-by: Nguyễn Thái Ngọc Duy
---
t/t1406-submodule-ref-store.sh (new +x) | 95 +
1 file changed, 95 insertions(+)
create mode 100755 t/t1406-submodule-ref-store.sh
diff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh
new file mode 1
It only has one caller, not worth keeping just for convenience.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/pack-refs.c | 2 +-
refs.c | 5 -
refs.h | 1 -
3 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
in
Signed-off-by: Nguyễn Thái Ngọc Duy
---
t/t1405-main-ref-store.sh (new +x) | 123 +
1 file changed, 123 insertions(+)
create mode 100755 t/t1405-main-ref-store.sh
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
new file mode 100755
index 00
This is not meant to cover all existing API. It adds enough to test ref
stores with the new test program test-ref-store, coming soon and to be
used by files-backend.c.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 251 ++-
refs.h
This function is intended to replace *_submodule() refs API. It provides
a ref store for a specific submodule, which can be operated on by a new
set of refs API.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 12
refs.h | 11 +++
refs/refs-inter
files-backend is now initialized with a $GIT_DIR. Converting a submodule
path to where real submodule gitdir is located is done in get_ref_store().
This gives a slight performance improvement for submodules since we
don't convert submodule path to gitdir at every backend call like
before. We pay t
The transaction struct now takes a ref store at creation and will
operate on that ref store alone.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 55
refs.h | 9 +
refs/refs-internal.h | 1 +
3 files cha
files-backend.c is unlearning submodules. Instead of having a specific
check for submodules to see what operation is allowed, files backend
now takes a set of flags at init. Each operation will check if the
required flags is present before performing.
For now we have four flags: read, write and od
refs is learning to avoid path rewriting that is done by
strbuf_git_path_submodule(). Factor out this code so it could be reused
by refs_* functions.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 35 +++
submodule.c | 31 +++
su
git_path() and friends are going to be killed in files-backend.c in near
future. And because there's a risk with overwriting buffer in
git_path(), let's convert them all to strbuf_git_path(). We'll have
easier time killing/converting strbuf_git_path() then because we won't
have to worry about memor
get_ref_store() will soon be renamed to get_submodule_ref_store().
Together with future get_worktree_ref_store(), the three functions
provide an appropriate ref store for different operation modes. New APIs
will be added to operate directly on ref stores.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Keep repo-related path handling in one place. This will make it easier
to add submodule/multiworktree support later.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 29 ++---
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/refs/files-backend
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index e7606716dd..8aa33af4e8 100644
--- a/refs.c
+++ b/refs.c
@@ -1456,15 +1456,20 @@ static struct ref_store *ref_store_init(const char
*submodule)
It's not in the diff context, but files_downcast() is called before this
check. If "refs" is NULL, we would have segfaulted before reaching the
check here. And we should never see NULL refs in backend code (frontend
should have caught it).
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backe
This makes reflog path building consistent, always in the form of
strbuf_git_path(sb, "logs/%s", refname);
It reduces the mental workload a bit in the next patch when that
function call is converted.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 10 +-
1 file chang
With get_main_ref_store() being used inside get_ref_store(),
lookup_ref_store() is only used for submodule code path. Rename to
reflect that and delete dead code.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/refs
Keep repo-related path handling in one place. This will make it easier
to add submodule/multiworktree support later.
This automatically adds the "if submodule then use the submodule version
of git_path" to other call sites too. But it does not mean those
operations are submodule-ready. Not yet.
S
This helps the future changes in this code. And because get_ref_store()
is destined to become get_submodule_ref_store(), the "get main store"
code path will be removed eventually. After this the patch to delete
that code will be cleaner.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 23 ++
Keep repo-related path handling in one place. This will make it easier
to add submodule/multiworktree support later.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 142 +++
1 file changed, 86 insertions(+), 56 deletions(-)
diff --g
Given $GIT_DIR and $GIT_COMMON_DIR, files-backend is now in charge of
deciding what goes where (*). The end goal is to pass $GIT_DIR only. A
refs "view" of a linked worktree is a logical ref store that combines
two files backends together.
(*) Not entirely true since strbuf_git_path_submodule() st
This is a no-op patch. It prepares the function so that we can release
resources (to be added later in this function) before we return.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 42 --
1 file changed, 28 insertions(+), 14 deletions(-)
This is the last function in this code (besides public API) that takes
submodule argument and handles both main/submodule cases. Break it down,
move main store registration in get_main_ref_store() and keep the rest
in register_submodule_ref_store().
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c
safe_create_dir() can do adjust_shared_perm() internally, and init-db
has always created 'refs' in shared mode since the beginning,
af6e277c5e (git-init-db: initialize shared repositories with --shared -
2005-12-22). So this code looks like extra adjust_shared_perm calls are
unnecessary.
And they
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
but probably never used outside refs-internal.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 9 ++---
refs/refs-internal.h | 4
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/refs/fi
v7 is mostly about style changes except the one bug in
test-ref-store.c, missing setup_git_directory().
There's one new patch, 03/28, which maps to the "if (!refs)" deletion
in the interdiff.
The one comment from v6 I haven't addressed in v7 is whether to delete
REF_STORE_READ. But if it is delet
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.h | 4
1 file changed, 4 insertions(+)
diff --git a/refs.h b/refs.h
index 3df0d45ebb..2d6b6263fc 100644
--- a/refs.h
+++ b/refs.h
@@ -1,6 +1,10 @@
#ifndef REFS_H
#define REFS_H
+struct object_id;
+struct strbuf;
+struct string_list;
+
/*
*
After a note is removed, note_tree_consolidate is called to eliminate
some useless nodes. The typical case is that if you had an int_node
with 2 PTR_TYPE_NOTEs in it, and remove one of them, then the
PTR_TYPE_INTERNAL pointer in the parent tree can be replaced with the
remaining PTR_TYPE_NOTE.
Thi
On Mon, Mar 20, 2017 at 4:18 AM, Michael Haggerty wrote:
>> +/* ref_store_init flags */
>> +#define REF_STORE_READ (1 << 0)
>
> I asked [1] in reply to v5 whether `REF_STORE_READ` is really necessary
> but I don't think you replied. Surely a reference store that we can't
> read would
On Sat, Mar 25, 2017 at 10:31 PM, Jeff King wrote:
> On Sat, Mar 25, 2017 at 05:47:49PM +0100, Ævar Arnfjörð Bjarmason wrote:
>
>> After looking at some of the internal APIs I'm thinking of replacing
>> this pattern with a hashmap.c hashmap where the keys are a
>> sprintf("%d:%s", short_name, long
--
Attn: Gewinner
Ihre E-Mail-Adresse hat die Summe von 1,200.000.00 Euro gewonnen.
Im Email Benützer Online Programm Weihnachtslotterie Navida , in Madrid
Spanien .
Wir schreiben ihnen ,um sich offiziel über die Auszeichnung zu
Benachrichtigen ,
damit Sie sich mit der Zuständigen Vermittleri
On Sat, Mar 25, 2017 at 12:51:52AM +0100, Ævar Arnfjörð Bjarmason wrote:
> They're changing their license[1] to Apache 2 which unlike the current
> fuzzy compatibility with the current license[2] is explicitly
> incompatible with GPLv2[3].
>
> We use OpenSSL for SHA1 by default unless NO_OPENSSL=Y
On Sat, Mar 25, 2017 at 10:44 PM, brian m. carlson
wrote:
> On Sat, Mar 25, 2017 at 12:51:52AM +0100, Ævar Arnfjörð Bjarmason wrote:
>> They're changing their license[1] to Apache 2 which unlike the current
>> fuzzy compatibility with the current license[2] is explicitly
>> incompatible with GPLv2
On Sat, Mar 25, 2017 at 10:11 PM, Theodore Ts'o wrote:
> On Sat, Mar 25, 2017 at 06:51:21PM +0100, Ęvar Arnfjörš Bjarmason wrote:
>> In GPLv3 projects only, not GPLv2 projects. The paragraphs you're
>> quoting all explicitly mention v3 only, so statements like
>> "incompatible in one direction" on
On Sat, Mar 25, 2017 at 05:47:49PM +0100, Ævar Arnfjörð Bjarmason wrote:
> After looking at some of the internal APIs I'm thinking of replacing
> this pattern with a hashmap.c hashmap where the keys are a
> sprintf("%d:%s", short_name, long_name) to uniquely identify the
> option. There's no other
On Fri, 2017-03-24 at 15:56 -0700, Junio C Hamano wrote:
> diff --git a/diff.c b/diff.c
> > index be11e4ef2b..2afecfb939 100644
> > --- a/diff.c
> > +++ b/diff.c
> > @@ -2815,7 +2815,7 @@ int diff_populate_filespec(struct diff_filespec *s,
> > unsigned int flags)
> > s->size = xsize_t
On Fri, Mar 24, 2017 at 11:10:13PM +, Ævar Arnfjörð Bjarmason wrote:
> On Sun, Mar 19, 2017 at 2:43 PM, Ævar Arnfjörð Bjarmason
> wrote:
> > I don't know if this is what Duy has in mind, but the facility I've
> > described is purely an internal code reorganization issue. I.e. us
> > not havi
On Sat, Mar 25, 2017 at 05:56:55PM +0100, René Scharfe wrote:
> Am 25.03.2017 um 17:17 schrieb Jeff King:
> > On Sat, Mar 25, 2017 at 01:16:42PM +0100, René Scharfe wrote:
> > > @@ -374,26 +372,9 @@ void log_write_email_headers(struct rev_info *opt,
> > > struct commit *commit,
> > > gr
I found out about "git bisect reset HEAD" while working on "git bisect
quit" but I think it's still worth it.
Let me know.
On Sat, Mar 25, 2017 at 3:17 PM, Edmundo Carmona Antoranz
wrote:
> git bisect quit will call git reset HEAD so that the working tree
> remains at the current revision
> ---
git bisect quit will call git reset HEAD so that the working tree
remains at the current revision
---
Documentation/git-bisect.txt | 12
git-bisect.sh| 11 ++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-bisect.txt b/Documen
On Sat, Mar 25, 2017 at 06:51:21PM +0100, Ævar Arnfjörð Bjarmason wrote:
> In GPLv3 projects only, not GPLv2 projects. The paragraphs you're
> quoting all explicitly mention v3 only, so statements like
> "incompatible in one direction" only apply to Apache 2 && GPLv3, but
> don't at all apply to GP
On Sat, Mar 25, 2017 at 12:24 AM, Johannes Schindelin
wrote:
> The collision detection is not for free, though: when using the SHA1DC
> code, calculating the SHA-1 takes substantially longer than using
> OpenSSL's (in some case hardware-accelerated) SHA1-routines, and this
> happens even when swit
On 03/25/2017 02:05 PM, Duy Nguyen wrote:
On Sat, Mar 25, 2017 at 07:26:14PM +0700, Duy Nguyen wrote:
On Sat, Mar 25, 2017 at 6:46 PM, Duy Nguyen wrote:
On Sat, Mar 25, 2017 at 5:46 PM, Torsten Bögershausen wrote:
./t1305-config-include.sh
seems to be broken:
not ok 19 - conditional includ
Create an option for the dir_iterator API to iterate over a directory
path only after having iterated through its contents. This feature was
predicted, although not implemented by 0fe5043 ("dir_iterator: new API
for iterating over a directory tree", 2016-06-18).
This is useful for recursively remo
Use dir_iterator to traverse through remove_subtree()'s directory tree,
avoiding the need for recursive calls to readdir(). Simplify
remove_subtree()'s code.
A conversion similar in purpose was previously done at 46d092a
("for_each_reflog(): reimplement using iterators", 2016-05-21).
Signed-off-b
This is the third version of the GSoC microproject
of refactoring remove_subtree() from recursively using
readdir() to use dir_iterator. Below are the threads for
other versions:
v1:
https://public-inbox.org/git/CAGZ79kZwT-9mHTiOJ5CEjk2wDFkn6+NcogjX0=vjhsah16a...@mail.gmail.com/T/#mae023e7a7d7626
On Sat, Mar 25, 2017 at 5:57 PM, demerphq wrote:
> On 25 March 2017 at 17:35, Ævar Arnfjörð Bjarmason wrote:
>> On Sat, Mar 25, 2017 at 10:43 AM, demerphq wrote:
>>>
>>>
>>> On 25 Mar 2017 10:18 a.m., "Ævar Arnfjörð Bjarmason"
>>> wrote:
>>>
>>> On Sat, Mar 25, 2017 at 9:40 AM, demerphq wrote:
Junio C Hamano writes:
> Which leads me to wonder if a more robust solution that is in line
> with the original design of sha1dc/sha1.c code may be to do an
> unconditional "#undef BIGENDIAN" before the above block, so that no
> matter what the calling environment sets BIGENDIAN to (including
> "
Junio C Hamano writes:
> The hash that names a packfile is constructed by sorting all the
> names of the objects contained in the packfile and running SHA-1
> hash over it.
Sorry, but I need to make a correction here.
This "SHA-1 over sorted object names" is a description of an ancient
behaviou
On 25 March 2017 at 17:35, Ævar Arnfjörð Bjarmason wrote:
> On Sat, Mar 25, 2017 at 10:43 AM, demerphq wrote:
>>
>>
>> On 25 Mar 2017 10:18 a.m., "Ævar Arnfjörð Bjarmason"
>> wrote:
>>
>> On Sat, Mar 25, 2017 at 9:40 AM, demerphq wrote:
>>> On 25 March 2017 at 00:51, Ævar Arnfjörð Bjarmason
>>
Am 25.03.2017 um 17:17 schrieb Jeff King:
On Sat, Mar 25, 2017 at 01:16:42PM +0100, René Scharfe wrote:
@@ -374,26 +372,9 @@ void log_write_email_headers(struct rev_info *opt, struct
commit *commit,
graph_show_oneline(opt->graph);
}
if (opt->mime_boundary) {
-
On Sat, Mar 25, 2017 at 12:10 AM, Ævar Arnfjörð Bjarmason
wrote:
> [...]
> This is all very proof-of-concept, and uses the ugly hack of s/const
> // for the options struct because I'm now keeping state in it, as
> noted in one of the TODO comments that should be moved.
> [...]
> static int parse
On Sat, Mar 25, 2017 at 10:43 AM, demerphq wrote:
>
>
> On 25 Mar 2017 10:18 a.m., "Ævar Arnfjörð Bjarmason"
> wrote:
>
> On Sat, Mar 25, 2017 at 9:40 AM, demerphq wrote:
>> On 25 March 2017 at 00:51, Ævar Arnfjörð Bjarmason
>> wrote:
>>> They're changing their license[1] to Apache 2 which unli
On Sat, Mar 25, 2017 at 01:16:42PM +0100, René Scharfe wrote:
> Use the after_subject member of struct pretty_print_context to pass the
> extra_headers unchanged, and construct and add the MIME boundary headers
> directly in pretty.c::pp_title_line() instead of writing both to a
> static buffer in
Le mercredi 22 mars 2017 11:02:09 CET, vous avez écrit :
> Jean-Noël Avila writes:
> >> I am wondering if Documentation/po part should be a separate
> >> repository, with a dedicated i18n/l10n coordinator. Would it make
> >> it easier for (1) those who write code and doc without knowing other
> >
On Sat, Mar 25, 2017 at 07:26:14PM +0700, Duy Nguyen wrote:
> On Sat, Mar 25, 2017 at 6:46 PM, Duy Nguyen wrote:
> > On Sat, Mar 25, 2017 at 5:46 PM, Torsten Bögershausen wrote:
> >> ./t1305-config-include.sh
> >> seems to be broken:
> >> not ok 19 - conditional include, $HOME expansion
> >> not
On Sat, Mar 25, 2017 at 7:13 PM, Daniel Ferreira (theiostream)
wrote:
> You are correct, which shows that since all tests pass, we need to
> come up with better cases for this function.
>
> As for a solution, I believe that the best way to go for it is to
> dir_iterator's implementation to have an
On Sat, Mar 25, 2017 at 6:46 PM, Duy Nguyen wrote:
> On Sat, Mar 25, 2017 at 5:46 PM, Torsten Bögershausen wrote:
>> ./t1305-config-include.sh
>> seems to be broken:
>> not ok 19 - conditional include, $HOME expansion
>> not ok 21 - conditional include, relative path
>
> let me guess, your "git"
Use the after_subject member of struct pretty_print_context to pass the
extra_headers unchanged, and construct and add the MIME boundary headers
directly in pretty.c::pp_title_line() instead of writing both to a
static buffer in log-tree.c::log_write_email_headers() first. That's
easier, quicker a
You are correct, which shows that since all tests pass, we need to
come up with better cases for this function.
As for a solution, I believe that the best way to go for it is to
dir_iterator's implementation to have an "Option to iterate over
directory paths before vs. after their contents" (somet
On Fri, Mar 24, 2017 at 12:55 AM, Junio C Hamano wrote:
> Michael J Gruber writes:
>
>> Are we at a point where we can still rename the new feature at least? If
>> yes, and keeping everything else is mandatory, than "workspace" or
>> "working space" may be a serious contender for naming the new t
On Tue, Mar 21, 2017 at 10:48 PM, Junio C Hamano wrote:
> Duy Nguyen writes:
>
>> On Tue, Mar 21, 2017 at 1:50 AM, Jonathan Nieder wrote:
>>> Junio C Hamano wrote:
Stefan Beller writes:
>>>
> While it may be true that you can have bare worktrees; I would question
> why anyone wants
On Wed, Mar 22, 2017 at 11:52 PM, Ben Peart wrote:
> We have a couple of patch series we’re working on (ObjectDB/Read-Object,
> Watchman integration)
Oops, sorry. I should be reworking the index-helper series for
watchman support, but I haven't time for it. Yes I'm also eyeing Lars
code as the co
On Sat, Mar 25, 2017 at 5:46 PM, Torsten Bögershausen wrote:
> ./t1305-config-include.sh
> seems to be broken:
> not ok 19 - conditional include, $HOME expansion
> not ok 21 - conditional include, relative path
let me guess, your "git" directory is in a symlink path?
--
Duy
On Wed, Mar 22, 2017 at 8:37 PM, Jeff King wrote:
> On Wed, Mar 22, 2017 at 09:34:12AM -0400, Jeff King wrote:
>
>> On Sat, Mar 18, 2017 at 09:03:34AM +0700, Nguyễn Thái Ngọc Duy wrote:
>>
>> > diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
>> > new file mode 100644
>>
>> When
On Sat, Mar 25, 2017 at 6:27 PM, Daniel Ferreira wrote:
> Use dir_iterator to traverse through remove_subtree()'s directory tree,
> avoiding the need for recursive calls to readdir(). Simplify
> remove_subtree()'s code.
>
> A conversion similar in purpose was previously done at 46d092a
> ("for_eac
Use dir_iterator to traverse through remove_subtree()'s directory tree,
avoiding the need for recursive calls to readdir(). Simplify
remove_subtree()'s code.
A conversion similar in purpose was previously done at 46d092a
("for_each_reflog(): reimplement using iterators", 2016-05-21).
Signed-off-b
./t1305-config-include.sh
seems to be broken:
not ok 19 - conditional include, $HOME expansion
not ok 21 - conditional include, relative path
Both Mac and Linux.
The problem seems to be the line
git config test.two >actual &&
and
git config test.four >actual &&
In both cases the config "test.tw
On Sat, Mar 25, 2017 at 9:40 AM, demerphq wrote:
> On 25 March 2017 at 00:51, Ævar Arnfjörð Bjarmason wrote:
>> They're changing their license[1] to Apache 2 which unlike the current
>> fuzzy compatibility with the current license[2] is explicitly
>> incompatible with GPLv2[3].
>
> Are you sure t
On 25 March 2017 at 00:51, Ævar Arnfjörð Bjarmason wrote:
> They're changing their license[1] to Apache 2 which unlike the current
> fuzzy compatibility with the current license[2] is explicitly
> incompatible with GPLv2[3].
Are you sure there is an issue? From the Apache page on this:
Apache 2
76 matches
Mail list logo