nfig.txt-pushdefault
--
Patryk Obara
On 31/05/2019 16:45, Cliff Schomburg wrote:
I'm proposing a shortcut for this command.
What's wrong with "$ git push -u origin branch"?
--
Patryk Obara
On 30/01/2018 02:38, Jeff King wrote:
On Sun, Jan 28, 2018 at 01:36:17AM +0100, Patryk Obara wrote:
This extension selects which hashing algorithm from vtable should be
used for reading and writing objects in the object store. At the moment
supports only single value (sha-1).
In case value
working tree to branch "name".
So just drop "-b". You can read more in manual for git-checkout:
https://git-scm.com/docs/git-checkout
(in polish) Jeśli masz jakieś konkretne pytania, to możesz napisać do
mnie po polsku :).
--
| ← Ceci n'est pas une pipe
Patryk Obara
object store. This extension behaviour is different
than preciousObjects extension (which is allowed in repo version 0).
Add tests and documentation note about new extension.
Signed-off-by: Patryk Obara
---
Documentation/technical/repository-version.txt | 12
setup.c
Compred to v2:
Fixed commit message.
Patryk Obara (1):
setup: recognise extensions.objectFormat
Documentation/technical/repository-version.txt | 12
setup.c| 27 ++
t/t1302-repo-version.sh
I looked at your branch object-id-part-12, and it conflicts with my next
batch of object_id conversions in quite many places (mostly through
formatting). Therefore I'll hold my horses and postpone my conversion
patches at least until part 12 will be sent.
--
| ← Ceci n'est pas une p
char packname[46];
+ char packname[GIT_MAX_HEXSZ + 6];
+ int len = the_hash_algo->hexsz + 6;
Just me nitpicking, but "len" can be const :)
--
| ← Ceci n'est pas une pipe
Patryk Obara
algo->rawsz) {
At this point line is almost 100 characters long - maybe it's time to
break it ;)
--
| ← Ceci n'est pas une pipe
Patryk Obara
);
I think it would be appropriate to replace "void *ctx" with
"git_hash_ctx *ctx". This way we can avoid unnecessary casting in
git_hash_sha1_* functions.
[1] https://wiki.openssl.org/index.php/Manual:EVP_DigestInit(3)#NOTES
--
| ← Ceci n'est pas une pipe
Patryk Obara
Compared to v1:
Implemented code suggestions from Duy Nguyễn (string for translation and
strbuf instead of char array). I also added an annotation in
repository-version.txt, clarifying, that this option is useful only for
development purpose for now.
Patryk Obara (1):
setup: recognise
store. This extension behaviour is different
than preciousObjects extension (which is allowed in repo version 0).
Add tests and documentation note about new extension.
Signed-off-by: Patryk Obara
---
Documentation/technical/repository-version.txt | 12
setup.c
used.
Signed-off-by: Patryk Obara
---
cache.h | 2 -
dir.c| 104 +--
dir.h| 12 ++--
t/helper/test-dump-untracked-cache.c | 4 +-
4 files changed, 58 insertions(+
ready. Separate
implementation of oidclr prevents potential buffer overrun in case
someone incorrectly used hashclr on object_id in future.
Signed-off-by: Patryk Obara
---
cache.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cache.h b/cache.h
index 08f2b81e1b..d5d78d6a51 1
.
Replace sha1_to_hex, hashcpy and hashclr with their oid equivalents
wherever possible.
Signed-off-by: Patryk Obara
---
apply.c | 8
builtin/checkout.c | 3 +--
builtin/mktag.c | 6 +++---
builtin/mktree.c | 10 +-
builtin/notes.c
Convert the definition and declaration of force_object_loose to
struct object_id and adjust usage of this function.
Signed-off-by: Patryk Obara
---
builtin/pack-objects.c | 2 +-
cache.h| 3 ++-
sha1_file.c| 10 +-
3 files changed, 8 insertions(+), 7
Convert the definition and declarations of combine_notes_* functions
to struct object_id and adjust usage of these functions.
Signed-off-by: Patryk Obara
---
notes.c | 46 +++---
notes.h | 25 +++--
2 files changed, 38 insertions
Convert the definition and declaration of static write_loose_object
function to struct object_id.
Signed-off-by: Patryk Obara
---
sha1_file.c | 28
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index d9ee966d74..59238f5bea
Convert the definitions and declarations of commit_tree and
commit_tree_extended to use struct object_id and adjust all usages of
these functions.
Signed-off-by: Patryk Obara
---
builtin/am.c | 4 ++--
builtin/commit-tree.c | 4 ++--
builtin/commit.c | 5 +++--
builtin/merge.c
load_oid_stat
- adjusted a comment, that included "sha1_stat" in text
Patch 11 (formerly 13)
- fixed a typo in the commit message
Hopefully, this will be the last iteration on this batch of object_id
conversions; I already have next batch prepared (I just need to clean
it up before sending).
Pa
Convert the declaration and definition of hash_sha1_file to use
struct object_id and adjust all function calls.
Rename this function to hash_object_file.
Signed-off-by: Patryk Obara
---
apply.c | 4 ++--
builtin/index-pack.c | 5 ++---
builtin/replace.c| 2
This function was already converted to use struct object_id earlier.
Signed-off-by: Patryk Obara
---
builtin/hash-object.c | 3 ++-
cache.h | 4 +++-
sha1_file.c | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/builtin/hash-object.c b/builtin
Convert the definition of static recursive splice_tree function to use
struct object_id and adjust single caller.
Signed-off-by: Patryk Obara
---
match-trees.c | 46 ++
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/match-trees.c b
Convert the declaration and definition of pretend_sha1_file to use
struct object_id and adjust all usages of this function. Rename it to
pretend_object_file.
Signed-off-by: Patryk Obara
---
Documentation/technical/api-object-access.txt | 2 +-
blame.c
Convert the definition and declaration of write_notes_tree to
struct object_id and adjust usage of this function.
Additionally, improve style of small part of this function, as old
formatting made it hard to understand at glance what this part of
code is doing.
Signed-off-by: Patryk Obara
ption e.g. when
objectFormat is set in repo, that is cloned with reference from repo
without extension.
--
| ← Ceci n'est pas une pipe
Patryk Obara
Argh! Forgot to sign-off the commit…
--
| ← Ceci n'est pas une pipe
Patryk Obara
This extension selects which hashing algorithm from vtable should be
used for reading and writing objects in the object store. At the moment
supports only single value (sha-1).
In case value of objectFormat is an unknown hashing algorithm, Git
command will fail with following message:
fatal: u
ready. Separate
implementation of oidclr prevents potential buffer overrun in case
someone incorrectly used hashclr on object_id in future.
Signed-off-by: Patryk Obara
---
cache.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cache.h b/cache.h
index 08f2b81e1b..d5d78d6a51 1
Convert the declaration and definition of pretend_sha1_file to use
struct object_id and adjust all usages of this function. Rename it to
pretend_object_file.
Signed-off-by: Patryk Obara
---
Documentation/technical/api-object-access.txt | 2 +-
blame.c
Convert the declaration and definition of hash_sha1_file to use
struct object_id and adjust all function calls.
Rename this function to hash_object_file.
Signed-off-by: Patryk Obara
---
apply.c | 4 ++--
builtin/index-pack.c | 5 ++---
builtin/replace.c| 2
pache dependency in Fedora 27:
https://bugzilla.redhat.com/show_bug.cgi?id=1491151
Signed-off-by: Patryk Obara
---
http-push.c | 4
1 file changed, 4 insertions(+)
diff --git a/http-push.c b/http-push.c
index 14435ab65d..0913f8ab86 100644
--- a/http-push.c
+++ b/http-push.c
@@ -915,6 +915,10 @@ s
Convert the declaration of struct sha1_stat. Adjust all usages of this
struct and replace hash{clr,cmp,cpy} with oid{clr,cmp,cpy} wherever
possible. Rename it to struct oid_stat.
Remove macro EMPTY_BLOB_SHA1_BIN, as it's no longer used.
Signed-off-by: Patryk Obara
---
ca
Convert the definition of static recursive splice_tree function to use
struct object_id and adjust single caller.
Signed-off-by: Patryk Obara
---
match-trees.c | 46 ++
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/match-trees.c b
Convert the definition and declaration of write_notes_tree to
struct object_id and adjust usage of this function.
Additionally, improve style of small part of this function, as old
formatting made it hard to understand at glance what this part of
code is doing.
Signed-off-by: Patryk Obara
).
I think this overwriting of object_id needs to be addressed, but
probably at the time of adjusting tree object format for longer hash.
Patryk Obara (14):
http-push: improve error log
clang-format: adjust penalty for return type line break
sha1_file: convert pretend_sha1_file to object_i
The penalty of 5 makes clang-format very eager to put even short type
declarations (e.g. "extern int") into a separate line, even when
breaking parameters list is sufficient.
Signed-off-by: Patryk Obara
---
.clang-format | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --gi
.
Replace sha1_to_hex, hashcpy and hashclr with their oid equivalents
wherever possible.
Signed-off-by: Patryk Obara
---
apply.c | 8
builtin/checkout.c | 3 +--
builtin/mktag.c | 6 +++---
builtin/mktree.c | 10 +-
builtin/notes.c
Convert the definition and declarations of combine_notes_* functions
to struct object_id and adjust usage of these functions.
Signed-off-by: Patryk Obara
---
notes.c | 46 +++---
notes.h | 25 +++--
2 files changed, 38 insertions
Convert the definition and declaration of force_object_loose to
struct object_id and adjust usage of this function.
Signed-off-by: Patryk Obara
---
builtin/pack-objects.c | 2 +-
cache.h| 3 ++-
sha1_file.c| 10 +-
3 files changed, 8 insertions(+), 7
Convert the definitions and declarations of commit_tree and
commit_tree_extended to use struct object_id and adjust all usages of
these functions.
Signed-off-by: Patryk Obara
---
builtin/am.c | 4 ++--
builtin/commit-tree.c | 4 ++--
builtin/commit.c | 5 +++--
builtin/merge.c
Convert the definition and declaration of statis write_loose_object
function to struct object_id.
Signed-off-by: Patryk Obara
---
sha1_file.c | 28
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index d9ee966d74..59238f5bea
This function was already converted to use struct object_id earlier.
Signed-off-by: Patryk Obara
---
builtin/hash-object.c | 3 ++-
cache.h | 4 +++-
sha1_file.c | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/builtin/hash-object.c b/builtin
nfo transitively depends on lookup_replace_object
and the other way around. verify_object and verify_tag will also cause some
problems.
--
| ← Ceci n'est pas une pipe
Patryk Obara
On 22 January 2018 at 12:56, Duy Nguyen wrote:
> On Mon, Jan 22, 2018 at 12:04:30PM +0100, Patryk Obara wrote:
>> Convert the definition of static recursive splice_tree function to use
>> struct object_id and adjust single caller.
>>
>> Signed-off-by: Patryk Obara
&g
On 22 January 2018 at 12:49, Duy Nguyen wrote:
> On Mon, Jan 22, 2018 at 12:04:28PM +0100, Patryk Obara wrote:
>> @@ -969,7 +969,7 @@ static int ident_to_worktree(const char *path, const
>> char *src, size_t len,
>>
>> /* step 4: substitute */
>>
Convert the definition and declarations of combine_notes_* functions
to struct object_id and adjust usage of these functions.
Signed-off-by: Patryk Obara
---
notes.c | 46 +++---
notes.h | 25 +++--
2 files changed, 38 insertions
This function was already converted to use struct object_id earlier.
---
builtin/hash-object.c | 3 ++-
cache.h | 4 +++-
sha1_file.c | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index c532ff9320..52
.
Replace sha1_to_hex, hashcpy and hashclr with their oid equivalents
wherever possible.
Signed-off-by: Patryk Obara
---
apply.c | 8
builtin/checkout.c | 3 +--
builtin/mktag.c | 6 +++---
builtin/mktree.c | 10 +-
builtin/notes.c
Convert the definition of static recursive splice_tree function to use
struct object_id and adjust single caller.
Signed-off-by: Patryk Obara
---
match-trees.c | 42 --
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/match-trees.c b/match
Convert the definition and declaration of statis write_loose_object
function to struct object_id.
Signed-off-by: Patryk Obara
---
sha1_file.c | 28
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index d9ee966d74..59238f5bea
Convert the definition and declaration of force_object_loose to
struct object_id and adjust usage of this function.
Signed-off-by: Patryk Obara
---
builtin/pack-objects.c | 2 +-
cache.h| 3 ++-
sha1_file.c| 10 +-
3 files changed, 8 insertions(+), 7
Convert the declaration and definition of pretend_sha1_file to use
struct object_id and adjust all usages of this function. Rename it to
pretend_object_file.
Signed-off-by: Patryk Obara
---
Documentation/technical/api-object-access.txt | 2 +-
blame.c
e_sha1_file -> write_object_file
hash_sha1_file -> hash_object_file
hash_sha1_file_literally -> hash_object_file_literally
Added two more patches converting some more functions to struct object_id
and one with pure function rename.
Patryk Obara (14):
http-push: improve error log
clang-format
Convert the declaration and definition of hash_sha1_file to use
struct object_id and adjust all function calls.
Rename this function to hash_object_file.
Signed-off-by: Patryk Obara
---
apply.c | 4 ++--
builtin/index-pack.c | 5 ++---
builtin/replace.c| 2
Convert the definitions and declarations of commit_tree and
commit_tree_extended to use struct object_id and adjust all usages of
these functions.
Signed-off-by: Patryk Obara
---
builtin/am.c | 4 ++--
builtin/commit-tree.c | 4 ++--
builtin/commit.c | 5 +++--
builtin/merge.c
pache dependency in Fedora 27:
https://bugzilla.redhat.com/show_bug.cgi?id=1491151
Signed-off-by: Patryk Obara
---
http-push.c | 4
1 file changed, 4 insertions(+)
diff --git a/http-push.c b/http-push.c
index 14435ab65d..0913f8ab86 100644
--- a/http-push.c
+++ b/http-push.c
@@ -915,6 +915,10 @@ s
The penalty of 5 makes clang-format very eager to put even short type
declarations (e.g. "extern int") into a separate line, even when
breaking parameters list is sufficient.
Signed-off-by: Patryk Obara
---
.clang-format | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --gi
Convert the declaration of struct sha1_stat. Adjust all usages of this
struct and replace hash{clr,cmp,cpy} with oid{clr,cmp,cpy} wherever
possible. Rename it to struct oid_stat.
Remove macro EMPTY_BLOB_SHA1_BIN, as it's no longer used.
Signed-off-by: Patryk Obara
---
ca
Convert the definition and declaration of write_notes_tree to
struct object_id and adjust usage of this function.
Additionally, improve style of small part of this function, as old
formatting made it hard to understand at glance what this part of
code is doing.
Signed-off-by: Patryk Obara
ready. Separate
implementation of oidclr prevents potential buffer overrun in case
someone incorrectly used hashclr on object_id in future.
Signed-off-by: Patryk Obara
---
cache.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cache.h b/cache.h
index 08f2b81e1b..d5d78d6a51 1
rting functions needed for cat-file, but number of places,
that still needs to be touched up grew quite rapidly, so it'll take some
time :).
--
| ← Ceci n'est pas une pipe
Patryk Obara
On 20 January 2018 at 21:44, brian m. carlson
wrote:
> On Thu, Jan 18, 2018 at 03:51:03PM +0100, Patryk Obara wrote:
>> diff --git a/sha1_file.c b/sha1_file.c
>> index 88b960316c..b7baf69041 100644
>> --- a/sha1_file.c
>> +++ b/sha1_file.c
>> @@ -1420,8 +1420,8 @@
Convert the declaration and definition of pretend_sha1_file to use
struct object_id and adjust all usages of this function.
Signed-off-by: Patryk Obara
---
blame.c | 2 +-
cache.h | 3 ++-
sha1_file.c | 8
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/blame.c b
Convert the declaration and definition of hash_sha1_file to use
struct object_id and adjust all function calls.
Signed-off-by: Patryk Obara
---
apply.c | 4 ++--
builtin/index-pack.c | 3 +--
builtin/replace.c| 2 +-
builtin/unpack-objects.c | 2 +-
cache-tree.c
Convert the definitions and declarations of commit_tree and
commit_tree_extended to use struct object_id and adjust all usages of
these functions.
Signed-off-by: Patryk Obara
---
builtin/am.c | 4 ++--
builtin/commit-tree.c | 4 ++--
builtin/commit.c | 5 +++--
builtin/merge.c
These should be somewhat uncontroversial, I hope.
Patryk Obara (11):
http-push: improve error log
clang-format: adjust penalty for return type line break
sha1_file: convert pretend_sha1_file to object_id
dir: convert struct sha1_stat to use object_id
sha1_file: convert hash_sha1_file to ob
Convert the definition and declaration of write_notes_tree to
struct object_id and adjust usage of this function.
Additionally, improve style of small part of this function, as old
formatting made it hard to understand at glance what this part of
code is doing.
Signed-off-by: Patryk Obara
Convert the definition and declarations of combine_notes_* functions
to struct object_id and adjust usage of these functions.
Signed-off-by: Patryk Obara
---
notes.c | 46 +++---
notes.h | 25 +++--
2 files changed, 38 insertions
The penalty of 5 makes clang-format very eager to put even short type
declarations (e.g. "extern int") into a separate line, even when
breaking parameters list is sufficient.
Signed-off-by: Patryk Obara
---
.clang-format | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --gi
.
Signed-off-by: Patryk Obara
---
apply.c | 8
builtin/checkout.c | 3 +--
builtin/mktag.c | 6 +++---
builtin/mktree.c | 10 +-
builtin/notes.c | 8
builtin/receive-pack.c | 11 ++-
builtin/replace.c| 2
pache dependency in Fedora 27:
https://bugzilla.redhat.com/show_bug.cgi?id=1491151
Signed-off-by: Patryk Obara
---
http-push.c | 4
1 file changed, 4 insertions(+)
diff --git a/http-push.c b/http-push.c
index 14435ab65d..0913f8ab86 100644
--- a/http-push.c
+++ b/http-push.c
@@ -915,6 +915,10 @@ s
Convert the declaration of struct sha1_stat. Adjust all usages of this
struct and replace hash{clr,cmp,cpy} with oid{clr,cmp,cpy} wherever
possible.
Remove macro EMPTY_BLOB_SHA1_BIN, as it's no longer used.
Signed-off-by: Patryk Obara
---
cache.h | 2 --
ready. Separate
implementation of oidclr prevents potential buffer overrun in case
someone incorrectly used hashclr on object_id in future.
Signed-off-by: Patryk Obara
---
cache.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cache.h b/cache.h
index b953d9f82c..cf98573805 1
Convert the definition of static recursive splice_tree function to use
struct object_id and adjust single caller.
Signed-off-by: Patryk Obara
---
match-trees.c | 42 --
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/match-trees.c b/match
Convert all remaining callers as well.
Signed-off-by: Patryk Obara
---
builtin/hash-object.c | 2 +-
cache.h | 2 +-
sha1_file.c | 8
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 8a58ce0
Convert all remaining callers as well.
Signed-off-by: Patryk Obara
---
builtin/difftool.c| 2 +-
builtin/hash-object.c | 2 +-
builtin/replace.c | 2 +-
cache.h | 2 +-
read-cache.c | 2 +-
sha1_file.c | 14 +++---
6 files changed, 12
Replace hashcmp with oidcmp.
Signed-off-by: Patryk Obara
---
read-cache.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index acfb028..7285608 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -160,9 +160,9 @@ static int ce_compare_data
Signed-off-by: Patryk Obara
---
sha1_file.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 3e2ef4e..8d6960a 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -3655,11 +3655,11 @@ static int index_core(unsigned char *sha1, int fd,
size_t
Convert all remaining callers as well.
Signed-off-by: Patryk Obara
---
builtin/update-index.c | 2 +-
cache.h| 2 +-
diff.c | 2 +-
notes-merge.c | 2 +-
read-cache.c | 2 +-
sha1_file.c| 10 +-
6 files changed, 10
Signed-off-by: Patryk Obara
---
builtin/hash-object.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index d04baf9..1c0f0f3 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -16,7 +16,7 @@
* needs
de regions
are being converted to struct object_id next?
I focused on this builtin in particular because it's probably
the smallest functionality, that can be converted to different
hashing algorithm, at least partly.
Patryk Obara (6):
builtin/hash-object: convert to struct object_id
read-ca
(or no flag) to preserve name in your cloned repository only.
--
| ← Ceci n'est pas une pipe
Patryk Obara
Ok, so that's an option - in this instance free is not actually needed
because it can be triggered only in phase 0, but it would add a bit of
robustness.
--
| ← Ceci n'est pas une pipe
Patryk Obara
Actually, I don't think I needed to remove free(graft) line, but I don't
know if freeing NULL is considered ok in git code. Let me know if I
should bring it back, please.
--
| ← Ceci n'est pas une pipe
Patryk Obara
about patch 4 from readability standpoint
(it's not immediately clear why parsing code can skip freeing of graft
in phase 2), but this implementation seems to address every issue raised
in review so far. If you'll prefer me to go back to impementation
from v3, I have it prepared ;)
Patry
function.
- Determining number of hashes by counting separators might cause
maintenance issues, if this function needs to be modified in future
again.
Signed-off-by: Patryk Obara
---
commit.c | 35 ---
1 file changed, 20 insertions(+), 15 deletions(-)
diff
The array is declared in cache.h as:
extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
Definition in sha1_file.c must match.
Signed-off-by: Patryk Obara
---
sha1_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1_file.c b/sha1_file.c
index b60ae15..f5b5bec
struct commit_graft aggregates an array of object_id's, which have
size >= GIT_MAX_RAWSZ bytes. This change prevents memory allocation
error when size of object_id is larger than GIT_SHA1_RAWSZ.
Signed-off-by: Patryk Obara
---
commit.c | 3 ++-
1 file changed, 2 insertions(+), 1
This simplifies function declaration and allows for use of strbuf_rtrim
instead of modifying buffer directly.
Signed-off-by: Patryk Obara
---
builtin/blame.c | 2 +-
commit.c| 23 +++
commit.h| 2 +-
3 files changed, 13 insertions(+), 14 deletions(-)
diff
Ah! I presumed two separate loops, one throwing away oids and second
one actually filling a table - this makes more sense. I was just about
to send v4, but will rewrite the last patch and we'll see how it looks
like.
--
| ← Ceci n'est pas une pipe
Patryk Obara
id struct. That
> way, you do not have to worry about two phrases going out of sync.
Two passes would still differ in error handling due to xmalloc between them…
--
| ← Ceci n'est pas une pipe
Patryk Obara
or with length check because
I thought it better shows intention of the code and I didn't notice, that
reversing order will result in better code overall.
I will include both changes in v4.
--
| ← Ceci n'est pas une pipe
Patryk Obara
struct commit_graft aggregates an array of object_id's, which have
size >= GIT_MAX_RAWSZ bytes. This change prevents memory allocation
error when size of object_id is larger than GIT_SHA1_RAWSZ.
Signed-off-by: Patryk Obara
---
commit.c | 3 ++-
1 file changed, 2 insertions(+), 1
Determine the number of object_id's to parse in a single graft line by
counting separators (whitespace characters) instead of dividing by
length of hash representation.
This way graft parsing code can support different sizes of hashes
without any further code adaptations.
Signed-off-by: P
The array is declared in cache.h as:
extern const unsigned char null_sha1[GIT_MAX_RAWSZ];
Definition in sha1_file.c must match.
Signed-off-by: Patryk Obara
---
sha1_file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sha1_file.c b/sha1_file.c
index b60ae15..f5b5bec
This simplifies function declaration and allows for use of strbuf_rtrim
instead of modifying buffer directly.
Signed-off-by: Patryk Obara
---
builtin/blame.c | 2 +-
commit.c| 15 ---
commit.h| 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a
,
memset, nor oid_array were not needed after all
Patryk Obara (4):
sha1_file: fix definition of null_sha1
commit: replace the raw buffer with strbuf in read_graft_line
commit: allocate array using object_id size
commit: rewrite read_graft_line
builtin/blame.c | 2 +-
commit.c
Understood :) - yes, oid_array is not completely necessary here - and it
gives the wrong impression about usage of this struct.
FLEX_ARRAY will be brought back in v3.
On Thu, Aug 17, 2017 at 11:20 PM, Junio C Hamano wrote:
> Patryk Obara writes:
>
>> The previous imple
;> and shouldn't have to care about the size. I really like parse_oid_hex()
>> for that reason (and I think parsing is the main place we've found that
>> needs to care).
>
> Yes.
--
| ← Ceci n'est pas une pipe
Patryk Obara
1 - 100 of 120 matches
Mail list logo