Re: Simple shortcut for "git push --set-upstream origin newBranchName"

2019-05-31 Thread Patryk Obara
nfig.txt-pushdefault -- Patryk Obara

Re: Simple shortcut for "git push --set-upstream origin newBranchName"

2019-05-31 Thread 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

Re: [PATCH v2 1/1] setup: recognise extensions.objectFormat

2018-01-30 Thread 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

Re: How juggle branches?

2018-01-29 Thread Patryk Obara
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

[PATCH v3 1/1] setup: recognise extensions.objectFormat

2018-01-29 Thread 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

[PATCH v3 0/1] setup: recognise extensions.objectFormat

2018-01-29 Thread Patryk Obara
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

Re: [PATCH 00/12] object_id part 11 (the_hash_algo)

2018-01-28 Thread Patryk Obara
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

Re: [PATCH 08/12] pack-write: switch various SHA-1 values to abstract forms

2018-01-28 Thread Patryk Obara
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

Re: [PATCH 06/12] fast-import: switch various uses of SHA-1 to the_hash_algo

2018-01-28 Thread 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

Re: [PATCH 02/12] hash: create union for hash context allocation

2018-01-28 Thread 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

[PATCH v2 0/1] setup: recognise extensions.objectFormat

2018-01-27 Thread 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

[PATCH v2 1/1] setup: recognise extensions.objectFormat

2018-01-27 Thread Patryk Obara
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

[PATCH v4 02/12] dir: convert struct sha1_stat to use object_id

2018-01-27 Thread Patryk Obara
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(+

[PATCH v4 04/12] cache: clear whole hash buffer with oidclr

2018-01-27 Thread 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

[PATCH v4 09/12] sha1_file: convert write_sha1_file to object_id

2018-01-27 Thread Patryk Obara
. 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

[PATCH v4 10/12] sha1_file: convert force_object_loose to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 07/12] notes: convert combine_notes_* to object_id

2018-01-27 Thread 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

[PATCH v4 11/12] sha1_file: convert write_loose_object to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 06/12] commit: convert commit_tree* to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 00/12] A bunch of object_id conversions

2018-01-27 Thread Patryk Obara
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

[PATCH v4 03/12] sha1_file: convert hash_sha1_file to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 12/12] sha1_file: rename hash_sha1_file_literally

2018-01-27 Thread Patryk Obara
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

[PATCH v4 05/12] match-trees: convert splice_tree to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 01/12] sha1_file: convert pretend_sha1_file to object_id

2018-01-27 Thread Patryk Obara
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

[PATCH v4 08/12] notes: convert write_notes_tree to object_id

2018-01-27 Thread Patryk Obara
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

Re: [PATCH] setup: recognise extensions.objectFormat

2018-01-26 Thread 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

Re: [PATCH] setup: recognise extensions.objectFormat

2018-01-24 Thread Patryk Obara
Argh! Forgot to sign-off the commit… -- | ← Ceci n'est pas une pipe Patryk Obara

[PATCH] setup: recognise extensions.objectFormat

2018-01-24 Thread 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

[PATCH v3 06/14] cache: clear whole hash buffer with oidclr

2018-01-24 Thread 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

[PATCH v3 03/14] sha1_file: convert pretend_sha1_file to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 05/14] sha1_file: convert hash_sha1_file to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 01/14] http-push: improve error log

2018-01-24 Thread Patryk Obara
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

[PATCH v3 04/14] dir: convert struct sha1_stat to use object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 07/14] match-trees: convert splice_tree to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 10/14] notes: convert write_notes_tree to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 00/14] Some fixes and bunch of object_id conversions

2018-01-24 Thread 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

[PATCH v3 02/14] clang-format: adjust penalty for return type line break

2018-01-24 Thread Patryk Obara
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

[PATCH v3 11/14] sha1_file: convert write_sha1_file to object_id

2018-01-24 Thread Patryk Obara
. 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

[PATCH v3 09/14] notes: convert combine_notes_* to object_id

2018-01-24 Thread 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

[PATCH v3 12/14] sha1_file: convert force_object_loose to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 08/14] commit: convert commit_tree* to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 13/14] sha1_file: convert write_loose_object to object_id

2018-01-24 Thread Patryk Obara
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

[PATCH v3 14/14] sha1_file: rename hash_sha1_file_literally

2018-01-24 Thread Patryk Obara
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

Re: [PATCH v2 00/14] Some fixes and bunch of object_id conversions

2018-01-22 Thread Patryk Obara
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

Re: [PATCH v2 07/14] match-trees: convert splice_tree to object_id

2018-01-22 Thread 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

Re: [PATCH v2 05/14] sha1_file: convert hash_sha1_file to object_id

2018-01-22 Thread Patryk Obara
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 */ >>

[PATCH v2 09/14] notes: convert combine_notes_* to object_id

2018-01-22 Thread 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

[PATCH v2 14/14] sha1_file: rename hash_sha1_file_literally

2018-01-22 Thread Patryk Obara
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

[PATCH v2 11/14] sha1_file: convert write_sha1_file to object_id

2018-01-22 Thread Patryk Obara
. 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

[PATCH v2 07/14] match-trees: convert splice_tree to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 13/14] sha1_file: convert write_loose_object to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 12/14] sha1_file: convert force_object_loose to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 03/14] sha1_file: convert pretend_sha1_file to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 00/14] Some fixes and bunch of object_id conversions

2018-01-22 Thread Patryk Obara
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

[PATCH v2 05/14] sha1_file: convert hash_sha1_file to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 08/14] commit: convert commit_tree* to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 01/14] http-push: improve error log

2018-01-22 Thread Patryk Obara
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

[PATCH v2 02/14] clang-format: adjust penalty for return type line break

2018-01-22 Thread Patryk Obara
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

[PATCH v2 04/14] dir: convert struct sha1_stat to use object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 10/14] notes: convert write_notes_tree to object_id

2018-01-22 Thread Patryk Obara
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

[PATCH v2 06/14] cache: clear whole hash buffer with oidclr

2018-01-22 Thread 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

Re: [PATCH 00/11] Some fixes and bunch of object_id conversions

2018-01-21 Thread Patryk Obara
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

Re: [PATCH 11/11] sha1_file: convert write_sha1_file to object_id

2018-01-21 Thread 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 @@

[PATCH 03/11] sha1_file: convert pretend_sha1_file to object_id

2018-01-18 Thread Patryk Obara
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

[PATCH 05/11] sha1_file: convert hash_sha1_file to object_id

2018-01-18 Thread Patryk Obara
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

[PATCH 08/11] commit: convert commit_tree* to object_id

2018-01-18 Thread Patryk Obara
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

[PATCH 00/11] Some fixes and bunch of object_id conversions

2018-01-18 Thread Patryk Obara
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

[PATCH 10/11] notes: convert write_notes_tree to object_id

2018-01-18 Thread Patryk Obara
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

[PATCH 09/11] notes: convert combine_notes_* to object_id

2018-01-18 Thread 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

[PATCH 02/11] clang-format: adjust penalty for return type line break

2018-01-18 Thread Patryk Obara
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

[PATCH 11/11] sha1_file: convert write_sha1_file to object_id

2018-01-18 Thread Patryk Obara
. 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

[PATCH 01/11] http-push: improve error log

2018-01-18 Thread Patryk Obara
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

[PATCH 04/11] dir: convert struct sha1_stat to use object_id

2018-01-18 Thread Patryk Obara
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 --

[PATCH 06/11] cache: clear whole hash buffer with oidclr

2018-01-18 Thread 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 b953d9f82c..cf98573805 1

[PATCH 07/11] match-trees: convert splice_tree to object_id

2018-01-18 Thread Patryk Obara
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

[PATCH 5/6] sha1_file: convert hash_sha1_file_literally to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 4/6] sha1_file: convert index_fd to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 2/6] read-cache: convert to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 6/6] sha1_file: convert index_stream to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 3/6] sha1_file: convert index_path to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 1/6] builtin/hash-object: convert to struct object_id

2017-08-20 Thread Patryk Obara
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

[PATCH 0/6] Convert hash-object to struct object_id

2017-08-20 Thread Patryk Obara
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

Re: Please fix the useless email prompts

2017-08-19 Thread Patryk Obara
(or no flag) to preserve name in your cloned repository only. -- | ← Ceci n'est pas une pipe Patryk Obara

Re: [PATCH v4 4/4] commit: rewrite read_graft_line

2017-08-18 Thread 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

Re: [PATCH v4 4/4] commit: rewrite read_graft_line

2017-08-18 Thread 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

[PATCH v4 0/4] Modernize read_graft_line implementation

2017-08-18 Thread 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

[PATCH v4 4/4] commit: rewrite read_graft_line

2017-08-18 Thread Patryk Obara
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

[PATCH v4 1/4] sha1_file: fix definition of null_sha1

2017-08-18 Thread Patryk Obara
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

[PATCH v4 3/4] commit: allocate array using object_id size

2017-08-18 Thread 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

[PATCH v4 2/4] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-18 Thread Patryk Obara
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

Re: [PATCH v3 4/4] commit: rewrite read_graft_line

2017-08-18 Thread Patryk Obara
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

Re: [PATCH v3 4/4] commit: rewrite read_graft_line

2017-08-18 Thread 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

Re: [PATCH v3 2/4] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-18 Thread 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

[PATCH v3 3/4] commit: allocate array using object_id size

2017-08-17 Thread 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

[PATCH v3 4/4] commit: rewrite read_graft_line

2017-08-17 Thread Patryk Obara
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

[PATCH v3 1/4] sha1_file: fix definition of null_sha1

2017-08-17 Thread Patryk Obara
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

[PATCH v3 2/4] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-17 Thread Patryk Obara
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

[PATCH v3 0/4] Modernize read_graft_line implementation

2017-08-17 Thread Patryk Obara
, 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

Re: [PATCH v2 4/4] commit: rewrite read_graft_line

2017-08-17 Thread Patryk Obara
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

Re: [PATCH 3/5] commit: replace the raw buffer with strbuf in read_graft_line

2017-08-17 Thread Patryk Obara
;> 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   2   >