summaryrefslogtreecommitdiff
path: root/builtin
Commit message (Collapse)AuthorAgeFilesLines
* ls-files: factor out tag calculationbw/ls-files-sans-the-indexBrandon Williams2017-06-131-16/+25
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: factor out debug info into a functionBrandon Williams2017-06-131-9/+14
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert show_files to take an indexBrandon Williams2017-06-131-15/+15
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert show_ce_entry to take an indexBrandon Williams2017-06-131-5/+6
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert prune_cache to take an indexBrandon Williams2017-06-131-7/+8
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert ce_excluded to take an indexBrandon Williams2017-06-131-4/+5
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert show_ru_info to take an indexBrandon Williams2017-06-131-4/+4
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert show_other_files to take an indexBrandon Williams2017-06-131-3/+4
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert show_killed_files to take an indexBrandon Williams2017-06-131-10/+11
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert write_eolinfo to take an indexBrandon Williams2017-06-131-7/+6
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* ls-files: convert overlay_tree_on_cache to take an indexBrandon Williams2017-06-132-8/+10
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* tree: convert read_tree to take an index parameterBrandon Williams2017-06-131-1/+1
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* convert: convert get_cached_convert_stats_ascii to take an indexBrandon Williams2017-06-131-1/+2
| | | | | Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'tb/pull-ff-rebase-autostash'Junio C Hamano2017-06-051-11/+14
|\ | | | | | | | | | | | | | | "git pull --rebase --autostash" didn't auto-stash when the local history fast-forwards to the upstream. * tb/pull-ff-rebase-autostash: pull: ff --rebase --autostash works in dirty repo
| * pull: ff --rebase --autostash works in dirty repotb/pull-ff-rebase-autostashTyler Brazier2017-06-011-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `git pull --rebase --autostash` in a dirty repository resulted in a fast-forward, nothing was being autostashed and the pull failed. This was due to a shortcut to avoid running rebase when we can fast-forward, but autostash is ignored on that codepath. Now we will only take the shortcut if autostash is not in effect. Based on a few tests against the git.git repo, the shortcut does not seem to give us significant performance benefits, on Linux at least. Regardless, it is more important to be correct than to be fast. Signed-off-by: Tyler Brazier <tyler@tylerbrazier.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'js/blame-lib'Junio C Hamano2017-06-052-2048/+65
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal logic used in "git blame" has been libified to make it easier to use by cgit. * js/blame-lib: (29 commits) blame: move entry prepend to libgit blame: move scoreboard setup to libgit blame: move scoreboard-related methods to libgit blame: move fake-commit-related methods to libgit blame: move origin-related methods to libgit blame: move core structures to header blame: create entry prepend function blame: create scoreboard setup function blame: create scoreboard init function blame: rework methods that determine 'final' commit blame: wrap blame_sort and compare_blame_final blame: move progress updates to a scoreboard callback blame: make sanity_check use a callback in scoreboard blame: move no_whole_file_rename flag to scoreboard blame: move xdl_opts flags to scoreboard blame: move show_root flag to scoreboard blame: move reverse flag to scoreboard blame: move contents_from to scoreboard blame: move copy/move thresholds to scoreboard blame: move stat counters to scoreboard ...
| * | blame: move entry prepend to libgitJeff Smith2017-05-251-14/+0
| | | | | | | | | | | | | | | Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move scoreboard setup to libgitJeff Smith2017-05-251-276/+0
| | | | | | | | | | | | | | | Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move scoreboard-related methods to libgitJeff Smith2017-05-251-1318/+0
| | | | | | | | | | | | | | | Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move fake-commit-related methods to libgitJeff Smith2017-05-251-197/+0
| | | | | | | | | | | | | | | Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move origin-related methods to libgitJeff Smith2017-05-251-72/+0
| | | | | | | | | | | | | | | Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move core structures to headerJeff Smith2017-05-251-133/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: create entry prepend functionJeff Smith2017-05-251-10/+15
| | | | | | | | | | | | | | | | | | | | | Create function that populates a blame_entry and prepends it to a list. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: create scoreboard setup functionJeff Smith2017-05-251-89/+101
| | | | | | | | | | | | | | | | | | | | | Create function that completes setting up blame_scoreboard structure. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: create scoreboard init functionJeff Smith2017-05-251-3/+8
| | | | | | | | | | | | | | | | | | | | | Create function that initializes blame_scoreboard to default values. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rework methods that determine 'final' commitJeff Smith2017-05-251-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: wrap blame_sort and compare_blame_finalJeff Smith2017-05-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move progress updates to a scoreboard callbackJeff Smith2017-05-251-10/+17
| | | | | | | | | | | | | | | | | | | | | Allow the interface user to decide how to handle a progress update. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: make sanity_check use a callback in scoreboardJeff Smith2017-05-241-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move no_whole_file_rename flag to scoreboardJeff Smith2017-05-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move xdl_opts flags to scoreboardJeff Smith2017-05-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move show_root flag to scoreboardJeff Smith2017-05-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move reverse flag to scoreboardJeff Smith2017-05-241-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move contents_from to scoreboardJeff Smith2017-05-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move copy/move thresholds to scoreboardJeff Smith2017-05-241-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move stat counters to scoreboardJeff Smith2017-05-241-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename nth_line functionJeff Smith2017-05-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename ent_score functionJeff Smith2017-05-241-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename coalesce functionJeff Smith2017-05-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Functions that will be publicly exposed should have names that better reflect what they are a part of. Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename origin-related functionsJeff Smith2017-05-241-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename scoreboard structure to blame_scoreboardJeff Smith2017-05-241-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: rename origin structure to blame_originJeff Smith2017-05-241-57/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: remove unused parametersJeff Smith2017-05-241-15/+10
| | | | | | | | | | | | | | | | | | | | | Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: move textconv_object with related functionsJeff Smith2017-05-242-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | blame: remove unneeded dependency on blob.hJeff Smith2017-05-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'mh/packed-ref-store-prep'Junio C Hamano2017-06-052-3/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation of "ref" API around the "packed refs" have been cleaned up, in preparation for further changes. * mh/packed-ref-store-prep: (25 commits) cache_ref_iterator_begin(): avoid priming unneeded directories ref-filter: limit traversal to prefix create_ref_entry(): remove `check_name` option refs_ref_iterator_begin(): handle `GIT_REF_PARANOIA` read_packed_refs(): report unexpected fopen() failures read_packed_refs(): do more of the work of reading packed refs get_packed_ref_cache(): assume "packed-refs" won't change while locked should_pack_ref(): new function, extracted from `files_pack_refs()` ref_update_reject_duplicates(): add a sanity check ref_update_reject_duplicates(): use `size_t` rather than `int` ref_update_reject_duplicates(): expose function to whole refs module ref_transaction_prepare(): new optional step for reference updates ref_transaction_commit(): check for valid `transaction->state` files_transaction_cleanup(): new helper function files_ref_store: put the packed files lock directly in this struct files-backend: move `lock` member to `files_ref_store` lockfile: add a new method, is_lock_file_locked() ref_store: take a `msg` parameter when deleting references refs: use `size_t` indexes when iterating over ref transaction updates refs_ref_iterator_begin(): don't check prefixes redundantly ...
| * | | ref_store: take a `msg` parameter when deleting referencesMichael Haggerty2017-05-232-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just because the files backend can't retain reflogs for deleted references is no reason that they shouldn't be supported by the virtual method interface. Also, `delete_ref()` and `refs_delete_ref()` have already gained `msg` parameters. Now let's add them to `delete_refs()` and `refs_delete_refs()`. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'bc/object-id'Junio C Hamano2017-05-2338-311/+331
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bc/object-id: (53 commits) object: convert parse_object* to take struct object_id tree: convert parse_tree_indirect to struct object_id sequencer: convert do_recursive_merge to struct object_id diff-lib: convert do_diff_cache to struct object_id builtin/ls-tree: convert to struct object_id merge: convert checkout_fast_forward to struct object_id sequencer: convert fast_forward_to to struct object_id builtin/ls-files: convert overlay_tree_on_cache to object_id builtin/read-tree: convert to struct object_id sha1_name: convert internals of peel_onion to object_id upload-pack: convert remaining parse_object callers to object_id revision: convert remaining parse_object callers to object_id revision: rename add_pending_sha1 to add_pending_oid http-push: convert process_ls_object and descendants to object_id refs/files-backend: convert many internals to struct object_id refs: convert struct ref_update to use struct object_id ref-filter: convert some static functions to struct object_id Convert struct ref_array_item to struct object_id Convert the verify_pack callback to struct object_id Convert lookup_tag to struct object_id ...
* | \ \ \ Merge branch 'mb/diff-default-to-indent-heuristics'Junio C Hamano2017-06-053-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the "indent" heuristics the default in "diff" and diff.indentHeuristics configuration variable an escape hatch for those who do no want it. * mb/diff-default-to-indent-heuristics: add--interactive: drop diff.indentHeuristic handling diff: enable indent heuristic by default diff: have the diff-* builtins configure diff before initializing revisions diff: make the indent heuristic part of diff's basic configuration
| * | | | | diff: have the diff-* builtins configure diff before initializing revisionsMarc Branchaud2017-05-093-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches how the diff Porcelain works. It makes the plumbing commands respect diff's configuration options, such as indentHeuristic, because init_revisions() calls diff_setup() which fills in the diff_options struct. Signed-off-by: Marc Branchaud <marcnarc@xiplink.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>