[RFC PATCH v2 05/22] blame: move scoreboard structure to header

2017-05-13 Thread Jeff Smith
The scoreboard structure is core to the blame interface. Since scoreboard will be more exposed, rename it to blame_scoreboard to clarify what it is a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 29 builtin/blame.

[RFC PATCH v2 10/22] blame: move show_root flag to scoreboard

2017-05-13 Thread Jeff Smith
The show_root flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 1 + builtin/blame.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff

[RFC PATCH v2 19/22] blame: move scoreboard-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 1313 ++ blame.h | 11 + builtin/blame.c | 1330 +-- 3 files changed, 1330 insertions(+), 1324 deletions(-)

[RFC PATCH v2 02/22] blame: move textconv_object with related functions

2017-05-13 Thread Jeff Smith
textconv_object is used in places other than blame.c and should be moved to a more appropriate location. Other textconv related functions are located in diff.c so that seems as good a place as any. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin.h | 2 -- builtin/b

[RFC PATCH v2 18/22] blame: move fake-commit-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 203 +++- blame.h | 4 +- builtin/blame.c | 197 -- 3 files changed, 205 insertions(+), 199 deletions(-)

[RFC PATCH v2 04/22] blame: move origin and entry structures to header

2017-05-13 Thread Jeff Smith
The origin and blame_entry structures are core to the blame interface and reference each other. Since origin will be more exposed, rename it to blame_origin to clarify what it is a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h

[RFC PATCH v2 08/22] blame: move contents_from to scoreboard

2017-05-13 Thread Jeff Smith
The argument from --contents is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 3 +++ builtin/blame.c | 1 + 2 files changed, 4 insertions(+) diff --git a/b

[RFC PATCH v2 07/22] blame: move copy/move thresholds to scoreboard

2017-05-13 Thread Jeff Smith
Copy and move score thresholds are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 10 ++ builtin/blame.c | 36 2

[RFC PATCH v2 15/22] blame: wrap blame_sort and compare_blame_final

2017-05-13 Thread Jeff Smith
The new method's interface is marginally cleaner than blame_sort, and will avoid the need to expose the compare_blame_final method. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/b

[RFC PATCH v2 17/22] blame: move origin-related methods to libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- Makefile| 1 + blame.c | 62 + blame.h | 15 +++ builtin/blame.c | 120 4 files changed, 102 insertions(+), 96 del

[RFC PATCH v2 20/22] blame: create scoreboard init function in libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 7 +++ blame.h | 2 ++ builtin/blame.c | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blame.c b/blame.c index 798e61b..17ebf64 100644 --- a/blame.c +++ b/blame.c @@ -1574,3 +1574,10 @

[RFC PATCH v2 13/22] blame: make sanity_check use a callback in scoreboard

2017-05-13 Thread Jeff Smith
Allow the interface user to decide how to handle a failed sanity check, whether that be to output with the current state or to do nothing. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 4 builtin/blame.c | 23 +++ 2 files changed, 19 inse

[RFC PATCH v2 09/22] blame: move reverse flag to scoreboard

2017-05-13 Thread Jeff Smith
The reverse flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 3 +++ builtin/blame.c | 20 +++- 2 files changed, 14 insertions(+), 9 del

[RFC PATCH v2 00/22] Add blame to libgit

2017-05-13 Thread Jeff Smith
into more atomic pieces Fleshed out commit message bodies Made public structure and method names more clearly blame-related Jeff Smith (22): blame: remove unneeded dependency on blob.h blame: move textconv_object with related functions blame: remove unused parameters blame: move origin

[RFC PATCH v2 03/22] blame: remove unused parameters

2017-05-13 Thread Jeff Smith
Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index c419981..e30b3ef 100644 --- a/b

[RFC PATCH v2 06/22] blame: move stat counters to scoreboard

2017-05-13 Thread Jeff Smith
Statistic counters are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 5 + builtin/blame.c | 29 - 2 files changed, 17 inse

[RFC PATCH v2 16/22] blame: rework methods that determine 'final' commit

2017-05-13 Thread Jeff Smith
Either prepare_initial or prepare_final is used to determine which commit is marked as 'final'. Call the underlying methods directly to make this more clear. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 49 +++-- 1 file c

[RFC PATCH v2 14/22] blame: move progess updates to a scoreboard callback

2017-05-13 Thread Jeff Smith
Allow the interface user to decide how to handle a progress update. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 3 +++ builtin/blame.c | 24 ++-- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/blame.h b/blame.h index e

[RFC PATCH v2 22/22] blame: create entry prepend function in libgit

2017-05-13 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 16 blame.h | 2 ++ builtin/blame.c | 11 +-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/blame.c b/blame.c index f6c9cb7..00404b9 100644 --- a/blame.c +++ b/b

[RFC PATCH v2 12/22] blame: move no_whole_file_rename flag to scoreboard

2017-05-13 Thread Jeff Smith
The no_whole_file_rename flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 1 + builtin/blame.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-)

[RFC PATCH v2 11/22] blame: move xdl_opts flags to scoreboard

2017-05-13 Thread Jeff Smith
The xdl_opts flags are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 1 + builtin/blame.c | 7 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff

[PATCH 22/29] blame: create scoreboard setup function

2017-05-23 Thread Jeff Smith
Create function that completes setting up blame_scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 190 ++-- 1 file changed, 101 insertions(+), 89 deletions(-) diff --git a/builtin/blame.c b/b

[PATCH 07/29] blame: rename coalesce function

2017-05-23 Thread Jeff Smith
Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index 7

[PATCH 24/29] blame: move core structures to header

2017-05-23 Thread Jeff Smith
The origin, entry, and scoreboard structures are core to the blame interface and need to be exposed for blame functionality. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.h | 143 builtin/blame.c

[PATCH 26/29] blame: move fake-commit-related methods to libgit

2017-05-23 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 203 +++- blame.h | 4 +- builtin/blame.c | 197 -- 3 files changed, 205 insertions(+), 199 deletions(-)

[PATCH 04/29] blame: rename origin structure to blame_origin

2017-05-23 Thread Jeff Smith
The origin structure is core to the blame interface. Since origin will become more exposed, rename it to blame_origin to clarify what it is a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 114

[PATCH 06/29] blame: rename origin-related functions

2017-05-23 Thread Jeff Smith
Functions related to blame_origin that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 58 - 1 file changed, 29 insertions(

[PATCH 02/29] blame: move textconv_object with related functions

2017-05-23 Thread Jeff Smith
textconv_object is used in places other than blame.c and should be moved to a more appropriate location. Other textconv related functions are located in diff.c so that seems as good a place as any. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin.h | 2 -- builtin/b

[PATCH 03/29] blame: remove unused parameters

2017-05-23 Thread Jeff Smith
Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index fbd757e..3529f01 100644 --- a/b

[PATCH 05/29] blame: rename scoreboard structure to blame_scoreboard

2017-05-23 Thread Jeff Smith
The scoreboard structure is core to the blame interface. Since scoreboard will become more exposed, rename it to blame_scoreboard to clarify what it is a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 58 --

[PATCH 11/29] blame: move copy/move thresholds to scoreboard

2017-05-23 Thread Jeff Smith
Copy and move score thresholds are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 41 +++-- 1 file changed, 23 insertions(

[PATCH 10/29] blame: move stat counters to scoreboard

2017-05-23 Thread Jeff Smith
Statistic counters are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-)

[PATCH 01/29] blame: remove unneeded dependency on blob.h

2017-05-23 Thread Jeff Smith
With commit 21666f1 ("convert object type handling from a string to a number", 2007-02-26), there was no longer a need for blame.c to include blob.h but it was not removed. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 1 - 1 file changed, 1 deletio

[PATCH 00/29] Add blame to libgit

2017-05-23 Thread Jeff Smith
to split out and group 'mechanical' changes Jeff Smith (29): blame: remove unneeded dependency on blob.h blame: move textconv_object with related functions blame: remove unused parameters blame: rename origin structure to blame_origin blame: rename scoreboard structure to blame_scoreboard

[PATCH 25/29] blame: move origin-related methods to libgit

2017-05-23 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- Makefile| 1 + blame.c | 62 + blame.h | 15 builtin/blame.c | 72 - 4 files changed, 78 inse

[PATCH 18/29] blame: move progess updates to a scoreboard callback

2017-05-23 Thread Jeff Smith
Allow the interface user to decide how to handle a progress update. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index 1b53325..d05907b

[PATCH 09/29] blame: rename nth_line function

2017-05-23 Thread Jeff Smith
Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c

[PATCH 14/29] blame: move show_root flag to scoreboard

2017-05-23 Thread Jeff Smith
The show_root flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/builtin/blame.c b/b

[PATCH 16/29] blame: move no_whole_file_rename flag to scoreboard

2017-05-23 Thread Jeff Smith
The no_whole_file_rename flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/b

[PATCH 12/29] blame: move contents_from to scoreboard

2017-05-23 Thread Jeff Smith
The argument from --contents is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 4 1 file changed, 4 insertions(+) diff --git a/builtin/blame.c b/b

[PATCH 23/29] blame: create entry prepend function

2017-05-23 Thread Jeff Smith
Create function that populates a blame_entry and prepends it to a list. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index fd41551..2

[PATCH 13/29] blame: move reverse flag to scoreboard

2017-05-23 Thread Jeff Smith
The reverse flag is used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff

[PATCH 19/29] blame: wrap blame_sort and compare_blame_final

2017-05-23 Thread Jeff Smith
The new method's interface is marginally cleaner than blame_sort, and will avoid the need to expose the compare_blame_final method. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/b

[PATCH 29/29] blame: move entry prepend to libgit

2017-05-23 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 16 blame.h | 2 ++ builtin/blame.c | 14 -- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/blame.c b/blame.c index f6c9cb7..00404b9 100644 --- a/blame.c +++ b/b

[PATCH 28/29] blame: move scoreboard setup to libgit

2017-05-23 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 279 +++- blame.h | 10 +- builtin/blame.c | 276 --- 3 files changed, 281 insertions(+), 284 deletions(-)

[PATCH 27/29] blame: move scoreboard-related methods to libgit

2017-05-23 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- blame.c | 1313 ++ blame.h | 11 + builtin/blame.c | 1318 --- 3 files changed, 1324 insertions(+), 1318 deletions(-)

[PATCH 08/29] blame: rename ent_score function

2017-05-23 Thread Jeff Smith
Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c

[PATCH 15/29] blame: move xdl_opts flags to scoreboard

2017-05-23 Thread Jeff Smith
The xdl_opts flags are used in parts of blame that are being moved to libgit, and should be accessible via the scoreboard structure. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/builtin/bla

[PATCH 21/29] blame: create scoreboard init function

2017-05-23 Thread Jeff Smith
Create function that initializes blame_scoreboard to default values. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index e343520..f839571 100644 --- a/b

[PATCH 17/29] blame: make sanity_check use a callback in scoreboard

2017-05-23 Thread Jeff Smith
Allow the interface user to decide how to handle a failed sanity check, whether that be to output with the current state or to do nothing. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-)

[PATCH 20/29] blame: rework methods that determine 'final' commit

2017-05-23 Thread Jeff Smith
Either prepare_initial or prepare_final is used to determine which commit is marked as 'final'. Call the underlying methods directly to make this more clear. Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 49 +++-- 1 file c

[RFC PATCH 04/10] Remove unused parameter from get_origin()

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index c419981..cc46f56 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -449,9 +449,7 @@ static

[RFC PATCH 10/10] Move scoreboard init and setup to lib

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 274 scoreboard.c| 273 +++ scoreboard.h| 2 + 3 files changed, 275 insertions(+), 274 deletions(-)

[RFC PATCH 08/10] Split blame scoreboard into its own file

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- Makefile|1 + builtin/blame.c | 1358 +-- scoreboard.c| 1296 scoreboard.h| 74 +++ 4 files changed, 1372 inse

[RFC PATCH 09/10] Break out scoreboard init and setup

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 264 +--- scoreboard.h| 1 + 2 files changed, 140 insertions(+), 125 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index 0af99e3..3bde5a6

[RFC PATCH 02/10] Move textconv_object to be with other textconv methods

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin.h | 2 -- builtin/blame.c| 28 builtin/cat-file.c | 1 + diff.c | 23 +++ diff.h | 7 +++ 5 files changed, 31 insertions(+), 30 del

[RFC PATCH 07/10] Break out scoreboard a little better

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 149 +++- 1 file changed, 93 insertions(+), 56 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index c873cc2..dc7600c 100644 --- a/builtin/blame.c +++ b/b

[RFC PATCH 00/10] Add blame to libgit

2017-05-04 Thread Jeff Smith
pieces from blame.c into libgit. The functionality left in blame.c mostly relates to terminal presentation. Jeff Smith (10): Remove unneeded dependency on blob.h from blame Move textconv_object to be with other textconv methods Add some missing definitions to header files Remove unused

[RFC PATCH 06/10] Move fake_working_tree_commit() to lib

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- Makefile| 1 + builtin/blame.c | 198 +-- commit-fake.c | 200 commit-fake.h | 9 +++ 4 files changed, 211 inse

[RFC PATCH 01/10] Remove unneeded dependency on blob.h from blame

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- builtin/blame.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/blame.c b/builtin/blame.c index 07506a3..42c56eb 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -8,7 +8,6 @@ #include "cache.h" #include &q

[RFC PATCH 03/10] Add some missing definitions to header files

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- object.h| 2 ++ pathspec.h | 4 refs.h | 3 +++ tree-walk.h | 2 ++ 4 files changed, 11 insertions(+) diff --git a/object.h b/object.h index f52957d..9737582 100644 --- a/object.h +++ b/object.h @@ -1,6 +1,8 @@ #ifndef OB

[RFC PATCH 05/10] Split blame origin into its own file

2017-05-04 Thread Jeff Smith
Signed-off-by: Jeff Smith <whydo...@gmail.com> --- Makefile| 1 + builtin/blame.c | 151 +--- origin.c| 62 +++ origin.h| 101 + 4 files changed, 165 inse