[PATCH v2 Outreachy] mru: use double-linked list from list.h

2017-09-30 Thread Olga Telezhnaya
Simplify mru.[ch] and related code by reusing the double-linked list implementation from list.h instead of a custom one. This commit is an intermediate step. Our final goal is to get rid of mru.[ch] at all and inline all logic. Signed-off-by: Olga Telezhnaia

[PATCH Outreachy] mru: use double-linked list from list.h

2017-09-28 Thread Olga Telezhnaya
Simplify mru.c, mru.h and related code by reusing the double-linked list implementation from list.h instead of a custom one. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH Outreachy 1/2] format: create pretty.h file

2017-12-08 Thread Olga Telezhnaya
Create header for pretty.c to make formatting interface more structured. This is a middle point, this file would be merged futher with other files which contain formatting stuff. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH Outreachy 2/2] format: create docs for pretty.h

2017-12-08 Thread Olga Telezhnaya
Write some docs for functions in pretty.h. Take it as a first draft, they would be changed later. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- pretty.h | 44

[PATCH Outreachy v2 1/2] format: create pretty.h file

2017-12-12 Thread Olga Telezhnaya
Create header for pretty.c to make formatting interface more structured. This is a middle point, this file would be merged further with other files which contain formatting stuff. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH Outreachy v2 2/2] format: create docs for pretty.h

2017-12-12 Thread Olga Telezhnaya
Write some docs for functions in pretty.h. Take it as a first draft, they would be changed later. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- pretty.h | 44

[PATCH RFC] ref-filter: start using oid_object_info

2018-05-14 Thread Olga Telezhnaya
Start using oid_object_info_extended(). So, if info from this function is enough, we do not need to get and parse whole object (as it was before). It's good for 3 reasons: 1. Some Git commands potentially will work faster. 2. It's much easier to add support for objectsize:disk and deltabase. (I

[PATCH RFC v2 1/4] ref-filter: start using oid_object_info

2018-05-18 Thread Olga Telezhnaya
Start using oid_object_info_extended(). So, if info from this function is enough, we do not need to get and parse whole object (as it was before). It's good for 3 reasons: 1. Some Git commands potentially will work faster. 2. It's much easier to add support for objectsize:disk and deltabase. (I

[PATCH RFC v2 2/4] ref-filter: add objectsize:disk formatting option

2018-05-18 Thread Olga Telezhnaya
Add %(objectsize:disk) support. It is still not working for deref: I am thinking how to support it in a more elegant way. Signed-off-by: Olga Telezhnaia --- ref-filter.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git

[PATCH RFC v2 4/4] ref-filter: add deltabase formatting option

2018-05-18 Thread Olga Telezhnaya
Add %(deltabase) support. It is still not working for deref: I am thinking how to support it in a more elegant way. Signed-off-by: Olga Telezhnaia --- ref-filter.c | 12 1 file changed, 12 insertions(+) diff --git a/ref-filter.c b/ref-filter.c index

[PATCH RFC v2 3/4] ref-filter: add tests for objectsize:disk

2018-05-18 Thread Olga Telezhnaya
Add tests for %(objectsize:disk) atom. Signed-off-by: Olga Telezhnaia --- t/t6300-for-each-ref.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index 295d1475bde01..570bb606045d7 100755 ---

[PATCH v2 10/18] cat-file: get rid of duplicate checking

2018-01-10 Thread Olga Telezhnaya
We could remove this because we have already checked that at verify_ref_format function in ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 2 -- 1 file

[PATCH v2 05/18] cat-file: start migrating to ref-filter

2018-01-10 Thread Olga Telezhnaya
Start moving all formatting stuff from cat-file to ref-filter. Start from simple moving, it would be integrated into all ref-filter processes further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH v2 07/18] cat-file: remove unused code

2018-01-10 Thread Olga Telezhnaya
No further need in mark_query parameter. All logic related to expand_atom_into_fields is not needed here also, we are doing that in ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH v2 12/18] ref-filter: make populate_value global

2018-01-10 Thread Olga Telezhnaya
Make function global for further using in cat-file. Also added return value for handling errors. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 4 ++-- ref-filter.h | 3

[PATCH v2 13/18] cat-file: start reusing populate_value

2018-01-10 Thread Olga Telezhnaya
Move logic related to getting object info from cat-file to ref-filter. It will help to reuse whole formatting logic from ref-filter further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH v2 09/18] cat-file: simplify expand_atom function

2018-01-10 Thread Olga Telezhnaya
Not sure, but looks like there is no need in that checking. There is a checking before whether it is null and we die in such case. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH v2 11/18] cat-file: start use ref_array_item struct

2018-01-10 Thread Olga Telezhnaya
Moving from using expand_data to ref_array_item structure. That helps us to reuse functions from ref-filter easier. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c |

[PATCH v2 03/18] ref-filter: make valid_atom as function parameter

2018-01-10 Thread Olga Telezhnaya
Make valid_atom as a function parameter, there could be another variable further. Need that for further reusing of formatting logic in cat-file.c. We do not need to allow users to pass their own valid_atom variable in global functions like verify_ref_format because in the end we want to have same

[PATCH v2 06/18] ref-filter: reuse parse_ref_filter_atom

2018-01-10 Thread Olga Telezhnaya
Continue migrating formatting logic from cat-file to ref-filter. Reuse parse_ref_filter_atom for unifying all processes in ref-filter and further reducing of expand_atom_into_fields function. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH v2 04/18] cat-file: move struct expand_data into ref-filter

2018-01-10 Thread Olga Telezhnaya
Need that for further reusing of formatting logic in cat-file. Have plans to get rid of using expand_data in cat-file at all, and use it only in ref-filter for collecting, formatting and printing needed data. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH v2 14/18] ref-filter: get rid of expand_atom_into_fields

2018-01-10 Thread Olga Telezhnaya
Remove expand_atom_into_fields function and create same logic in terms of ref-filter style. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 45

[PATCH v2 16/18] ref_format: add split_on_whitespace flag

2018-01-10 Thread Olga Telezhnaya
Add flag to ref_format struct so that we could pass needed info to cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 4 ++--

[PATCH v2 08/18] ref-filter: get rid of goto

2018-01-10 Thread Olga Telezhnaya
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 103

[PATCH v2 02/18] cat-file: reuse struct ref_format

2018-01-10 Thread Olga Telezhnaya
Start using ref_format struct instead of simple char*. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH v2 18/18] ref-filter: make cat_file_info independent

2018-01-10 Thread Olga Telezhnaya
Remove connection between expand_data variable in cat-file and in ref-filter. It will help further to get rid of using expand_data in cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH v2 01/18] cat-file: split expand_atom into 2 functions

2018-01-10 Thread Olga Telezhnaya
Split expand_atom function into 2 different functions, expand_atom_into_fields prepares variable for further filling, (new) expand_atom creates resulting string. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia

[PATCH v2 15/18] ref-filter: add is_cat flag

2018-01-10 Thread Olga Telezhnaya
Add is_cat flag, further it helps to get rid of cat_file_data field in ref_format. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 8

[PATCH v2 17/18] cat-file: move skip_object_info into ref-filter

2018-01-10 Thread Olga Telezhnaya
Move logic related to skip_object_info into ref-filter, so that cat-file does not use that field at all. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 7 +--

[PATCH 17/20] cat-file: add is_cat flag in ref-filter

2018-01-09 Thread Olga Telezhnaya
Add is_cat flag, further it helps to get rid of cat_file_data field in ref_format. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 8

[PATCH 08/20] cat-file: remove unused code

2018-01-09 Thread Olga Telezhnaya
No further need in mark_query parameter. All logic related to expand_atom_into_fields is not needed here also, we are doing that in ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH 03/20] cat-file: rename variables in ref-filter

2018-01-09 Thread Olga Telezhnaya
Rename some variables for easier reading. They point not to values, but to arrays. Added "s" ending so that it could be obvious. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH 20/20] cat-file: make cat_file_info variable independent

2018-01-09 Thread Olga Telezhnaya
Remove connection between expand_data variable in cat-file and in ref-filter. It will help further to get rid of using expand_data in cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH 13/20] cat-file: start use ref_array_item struct

2018-01-09 Thread Olga Telezhnaya
Moving from using expand_data to ref_array_item structure. That helps us to reuse functions from ref-filter easier. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c |

[PATCH 16/20] cat-file: get rid of expand_atom_into_fields

2018-01-09 Thread Olga Telezhnaya
Remove expand_atom_into_fields function and create same logic in terms of ref-filter style. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 45

[PATCH 01/20] cat-file: split expand_atom into 2 functions

2018-01-09 Thread Olga Telezhnaya
Split expand_atom function into 2 different functions, expand_atom_into_fields prepares variable for further filling, (new) expand_atom creates resulting string. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia

[PATCH 18/20] cat-file: add split_on_whitespace flag

2018-01-09 Thread Olga Telezhnaya
Add flag to ref_format struct so that we could pass needed info to cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 4 ++--

[PATCH 12/20] cat-file: rename variable in ref-filter

2018-01-09 Thread Olga Telezhnaya
Rename variable for easier reading. It points not to values, but to arrays. Added "s" ending so that it could be obvious. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c |

[PATCH 02/20] cat-file: reuse struct ref_format

2018-01-09 Thread Olga Telezhnaya
Start using ref_format struct instead of simple char*. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH 06/20] cat-file: start migrating to ref-filter

2018-01-09 Thread Olga Telezhnaya
Start moving all formatting stuff from cat-file to ref-filter. Start from simple moving, it would be integrated into all ref-filter processes further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH 07/20] cat-file: reuse parse_ref_filter_atom

2018-01-09 Thread Olga Telezhnaya
Continue migrating formatting logic from cat-file to ref-filter. Reuse parse_ref_filter_atom for unifying all processes in ref-filter and further reducing of expand_atom_into_fields function. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH 05/20] cat-file: move struct expand_data into ref-filter

2018-01-09 Thread Olga Telezhnaya
Need that for further reusing of formatting logic in cat-file. Have plans to get rid of using expand_data in cat-file at all, and use it only in ref-filter for collecting, formatting and printing needed data. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH 04/20] cat-file: make valid_atoms as a function parameter

2018-01-09 Thread Olga Telezhnaya
Make valid_atoms as a function parameter, there could be another variable further. Need that for further reusing of formatting logic in cat-file.c. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH 15/20] cat-file: start reusing populate_value

2018-01-09 Thread Olga Telezhnaya
Move logic related to getting object info from cat-file to ref-filter. It will help to reuse whole formatting logic from ref-filter further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH 19/20] cat-file: move skip_object_info into ref-filter

2018-01-09 Thread Olga Telezhnaya
Move logic related to skip_object_info into ref-filter, so that cat-file does not use that field at all. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 7 +--

[PATCH 14/20] cat-file: make populate_value global

2018-01-09 Thread Olga Telezhnaya
Make function global for further using in cat-file. Also added return value for handling errors. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 4 ++-- ref-filter.h | 3

[PATCH 09/20] cat-file: get rid of goto in ref-filter

2018-01-09 Thread Olga Telezhnaya
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 103

[PATCH 10/20] cat-file: simplify expand_atom function

2018-01-09 Thread Olga Telezhnaya
Not sure, but looks like there is no need in that checking. There is a checking before whether it is null and we die in such case. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH 11/20] cat-file: get rid of duplicate checking

2018-01-09 Thread Olga Telezhnaya
We could remove this because we have already checked that at verify_ref_format function in ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 2 -- 1 file

[PATCH RFC 19/24] ref-filter: make populate_value internal again

2018-01-26 Thread Olga Telezhnaya
Remove populate_value from header file. We needed that for interim step, now it could be returned back. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 2 +-

[PATCH RFC 20/24] ref-filter: unifying formatting of cat-file opts

2018-01-26 Thread Olga Telezhnaya
cat-file options are now filled by general logic. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 31 ++- 1 file changed, 14 insertions(+),

[PATCH RFC 13/24] ref-filter: add is_cat flag

2018-01-26 Thread Olga Telezhnaya
Add is_cat flag, further it helps to get rid of cat_file_data field in ref_format. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 8

[PATCH RFC 03/24] cat-file: split expand_atom into 2 functions

2018-01-26 Thread Olga Telezhnaya
Split expand_atom function into 2 different functions, expand_atom_into_fields prepares variable for further filling, (new) expand_atom creates resulting string. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia

[PATCH RFC 16/24] ref-filter: make cat_file_info independent

2018-01-26 Thread Olga Telezhnaya
Remove connection between expand_data variable in cat-file and in ref-filter. It will help further to get rid of using expand_data in cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH RFC 14/24] ref_filter: add is_rest_atom_used function

2018-01-26 Thread Olga Telezhnaya
Delete all items related to split_on_whitespace from ref-filter and add new function for handling the logic. Now cat-file could invoke that function to implementing its logic. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC 18/24] ref-filter: make valid_atom general again

2018-01-26 Thread Olga Telezhnaya
Stop using valid_cat_file_atom, making the code more general. Further commits will contain some tests, docs and support of new features. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH RFC 01/24] ref-filter: get rid of goto

2018-01-26 Thread Olga Telezhnaya
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 103

[PATCH RFC 10/24] ref-filter: make populate_value global

2018-01-26 Thread Olga Telezhnaya
Make function global for further using in cat-file. In the end of patch series this function becomes internal again, so this is a part of middle step. cat-file would use more general functions further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC 23/24] cat-file: tests for new atoms added

2018-01-26 Thread Olga Telezhnaya
Add some tests for new formatting atoms from ref-filter. Some of new atoms are supported automatically, some of them are expanded into empty string (because they are useless for some types of objects), some of them could be supported later in other patches. Signed-off-by: Olga Telezhnaia

[PATCH RFC 17/24] cat-file: reuse printing logic from ref-filter

2018-01-26 Thread Olga Telezhnaya
Reuse code from ref-filter to print resulting message. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 52 +---

[PATCH RFC 22/24] for-each-ref: tests for new atoms added

2018-01-26 Thread Olga Telezhnaya
Add tests for new formatting atoms: rest, deltabase, objectsize:disk. rest means nothing and we expand it into empty string. We need this atom for cat-file command. Have plans to support deltabase and objectsize:disk further (as it is done in cat-file), now also expand it to empty string.

[PATCH RFC 12/24] ref-filter: get rid of expand_atom_into_fields

2018-01-26 Thread Olga Telezhnaya
Remove expand_atom_into_fields function and create same logic in terms of ref-filter style. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 45

[PATCH RFC 05/24] ref-filter: make valid_atom as function parameter

2018-01-26 Thread Olga Telezhnaya
Make valid_atom as a function parameter, there could be another variable further. Need that for further reusing of formatting logic in cat-file.c. We do not need to allow users to pass their own valid_atom variable in global functions like verify_ref_format because in the end we want to have same

[PATCH RFC 06/24] cat-file: move struct expand_data into ref-filter

2018-01-26 Thread Olga Telezhnaya
Need that for further reusing of formatting logic in cat-file. Have plans to get rid of using expand_data in cat-file at all, and use it only in ref-filter for collecting, formatting and printing needed data. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC 07/24] cat-file: start migrating to ref-filter

2018-01-26 Thread Olga Telezhnaya
Start moving formatting stuff related to data preparation from cat-file to ref-filter. Start from simple moving, it would be integrated into all ref-filter processes further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC 21/24] ref-filter: work with objectsize:disk

2018-01-26 Thread Olga Telezhnaya
Make a temporary solution for commands that could use objectsize:disk atom. It's better to fill it with value or give an error if there is no value for this atom, but as a first solution we do dothing. It means that if objectsize:disk is used, we put an empty string there. Signed-off-by: Olga

[PATCH RFC 11/24] cat-file: start reusing populate_value

2018-01-26 Thread Olga Telezhnaya
Move logic related to getting object info from cat-file to ref-filter. It will help to reuse whole formatting logic from ref-filter further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH RFC 09/24] cat-file: start use ref_array_item struct

2018-01-26 Thread Olga Telezhnaya
Moving from using expand_data to ref_array_item structure. That helps us to reuse functions from ref-filter easier. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c |

[PATCH RFC 04/24] cat-file: reuse struct ref_format

2018-01-26 Thread Olga Telezhnaya
Start using ref_format struct instead of simple char*. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH RFC 24/24] cat-file: update of docs

2018-01-26 Thread Olga Telezhnaya
Update the docs for cat-file command. Some new formatting atoms added because of reusing ref-filter code. We do not support cat-file atoms in general formatting logic (there is just the support for cat-file), that is why some of the atoms are still explained in cat-file docs. We need to move these

[PATCH RFC 08/24] ref-filter: reuse parse_ref_filter_atom

2018-01-26 Thread Olga Telezhnaya
Continue migrating formatting logic from cat-file to ref-filter. Reuse parse_ref_filter_atom for unifying all processes in ref-filter and further reducing of expand_atom_into_fields function. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC 15/24] cat-file: move skip_object_info into ref-filter

2018-01-26 Thread Olga Telezhnaya
Move logic related to skip_object_info into ref-filter, so that cat-file does not use that field at all. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 7 +--

[PATCH RFC 02/24] ref-filter: add return value to some functions

2018-01-26 Thread Olga Telezhnaya
Add return flag to format_ref_array_item, show_ref_array_item, get_ref_array_info and populate_value for further using. Need it to handle situations when item is broken but we can not invoke die() because we are in batch mode and all items need to be processed. Signed-off-by: Olga Telezhnaia

[PATCH RFC v2 17/25] ref-filter: make cat_file_info independent

2018-02-05 Thread Olga Telezhnaya
Remove connection between expand_data variable in cat-file and in ref-filter. It will help further to get rid of using expand_data in cat-file. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH RFC v2 14/25] ref-filter: add is_cat flag

2018-02-05 Thread Olga Telezhnaya
Add is_cat flag, further it helps to get rid of cat_file_data field in ref_format. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 1 + ref-filter.c | 8

[PATCH RFC v2 23/25] for-each-ref: tests for new atoms added

2018-02-05 Thread Olga Telezhnaya
Add tests for new formatting atoms: rest, deltabase, objectsize:disk. rest means nothing and we expand it into empty string. We need this atom for cat-file command. Have plans to support deltabase and objectsize:disk further (as it is done in cat-file), now also expand it to empty string.

[PATCH RFC v2 07/25] cat-file: start migrating formatting to ref-filter

2018-02-05 Thread Olga Telezhnaya
Move mark_atom_in_object_info() from cat-file to ref-filter and start using it in verify_ref_format(). It also means that we start reusing verify_ref_format() in cat-file. Start from simple moving of mark_atom_in_object_info(), it would be removed later by integrating all needed processes into

[PATCH RFC v2 09/25] cat-file: start use ref_array_item struct

2018-02-05 Thread Olga Telezhnaya
Moving from using expand_data to ref_array_item structure. That helps us to reuse functions from ref-filter easier. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c |

[PATCH RFC v2 22/25] ref-filter: work with objectsize:disk

2018-02-05 Thread Olga Telezhnaya
Make a temporary solution for commands that could use objectsize:disk atom. It's better to fill it with value or give an error if there is no value for this atom, but as a first solution we do dothing. It means that if objectsize:disk is used, we put an empty string there. Signed-off-by: Olga

[PATCH RFC v2 05/25] cat-file: move struct expand_data into ref-filter

2018-02-05 Thread Olga Telezhnaya
Need that for further reusing of formatting logic in cat-file. Have plans to get rid of using expand_data in cat-file at all, and use it only in ref-filter for collecting, formatting and printing needed data. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC v2 08/25] ref-filter: reuse parse_ref_filter_atom()

2018-02-05 Thread Olga Telezhnaya
Continue migrating formatting logic from cat-file to ref-filter. Reuse parse_ref_filter_atom() for unifying all processes in ref-filter and further removing of mark_atom_in_object_info(). Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC v2 20/25] ref-filter: make populate_value() internal again

2018-02-05 Thread Olga Telezhnaya
Remove populate_value() from header file. We needed that for interim step, now it could be returned back. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 2 +-

[PATCH RFC v2 04/25] ref-filter: make valid_atom as function parameter

2018-02-05 Thread Olga Telezhnaya
Make valid_atom as a function parameter, there could be another variable further. Need that for further reusing of formatting logic in cat-file.c. We do not need to allow users to pass their own valid_atom variable in global functions like verify_ref_format() because in the end we want to have

[PATCH RFC v2 15/25] ref_filter: add is_atom_used function

2018-02-05 Thread Olga Telezhnaya
Delete all items related to split_on_whitespace from ref-filter and add new function for handling the logic. Now cat-file could invoke that function to implementing its logic. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH RFC v2 19/25] cat-file: reuse printing logic from ref-filter

2018-02-05 Thread Olga Telezhnaya
Reuse code from ref-filter to print resulting message. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 51 ---

[PATCH RFC v2 18/25] ref-filter: make valid_atom general again

2018-02-05 Thread Olga Telezhnaya
Stop using valid_cat_file_atom, making the code more general. Further commits will contain some tests, docs and support of new features. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH RFC v2 25/25] cat-file: update of docs

2018-02-05 Thread Olga Telezhnaya
Update the docs for cat-file command. Some new formatting atoms added because of reusing ref-filter code. We do not support cat-file atoms in general formatting logic (there is just the support for cat-file), that is why some of the atoms are still explained in cat-file docs. We need to move these

[PATCH RFC v2 12/25] cat-file: start reusing populate_value()

2018-02-05 Thread Olga Telezhnaya
Move logic related to getting object info from cat-file to ref-filter. It will help to reuse whole formatting logic from ref-filter further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH RFC v2 03/25] cat-file: reuse struct ref_format

2018-02-05 Thread Olga Telezhnaya
Start using ref_format struct instead of simple char*. Need that for further reusing of formatting logic from ref-filter. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King ---

[PATCH RFC v2 02/25] ref-filter: add return value to some functions

2018-02-05 Thread Olga Telezhnaya
Add return flag to format_ref_array_item(), show_ref_array_item(), get_ref_array_info() and populate_value() for further using. Need it to handle situations when item is broken but we can not invoke die() because we are in batch mode and all items need to be processed. Signed-off-by: Olga

[PATCH RFC v2 24/25] cat-file: tests for new atoms added

2018-02-05 Thread Olga Telezhnaya
Add some tests for new formatting atoms from ref-filter. Some of new atoms are supported automatically, some of them are expanded into empty string (because they are useless for some types of objects), some of them could be supported later in other patches. Signed-off-by: Olga Telezhnaia

[PATCH RFC v2 21/25] ref-filter: unifying formatting of cat-file opts

2018-02-05 Thread Olga Telezhnaya
cat-file options are now filled by general logic. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 31 ++- 1 file changed, 14 insertions(+),

[PATCH RFC v2 06/25] cat-file: split expand_atom() into 2 functions

2018-02-05 Thread Olga Telezhnaya
Split expand_atom() into 2 different functions, mark_atom_in_object_info() prepares variable for further filling, (new) expand_atom() creates resulting string. Need that for further reusing of formatting logic from ref-filter. Both functions will be step-by-step removed by the end of this patch.

[PATCH RFC v2 13/25] ref-filter: get rid of mark_atom_in_object_info()

2018-02-05 Thread Olga Telezhnaya
Remove mark_atom_in_object_info() and create same logic in terms of ref-filter style. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 45

[PATCH RFC v2 01/25] ref-filter: get rid of goto

2018-02-05 Thread Olga Telezhnaya
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 9 + 1 file changed, 5 insertions(+), 4

[PATCH RFC v2 11/25] ref-filter: rename field in ref_array_item stuct

2018-02-05 Thread Olga Telezhnaya
Rename objectname field to oid in struct ref_array_item. Next commit will add objectname field that will contain string representation of object id. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King

[PATCH RFC v2 16/25] cat-file: move skip_object_info into ref-filter

2018-02-05 Thread Olga Telezhnaya
Move logic related to skip_object_info into ref-filter, so that cat-file does not use that field at all. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- builtin/cat-file.c | 7 +--

[PATCH RFC v2 10/25] ref-filter: make populate_value() global

2018-02-05 Thread Olga Telezhnaya
Make function global for further using in cat-file. In the end of patch series this function becomes internal again, so this is a part of middle step. cat-file would use more general functions further. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH v3 08/23] ref-filter: reuse parse_ref_filter_atom()

2018-02-12 Thread Olga Telezhnaya
Continue migrating formatting logic from cat-file to ref-filter. Reuse parse_ref_filter_atom() for unifying all processes in ref-filter and further removing of mark_atom_in_object_info(). Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder

[PATCH v3 01/23] ref-filter: get rid of goto

2018-02-12 Thread Olga Telezhnaya
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia Mentored-by: Christian Couder Mentored by: Jeff King --- ref-filter.c | 9 + 1 file changed, 5 insertions(+), 4

  1   2   >