git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* What's cooking in git.git (May 2017, #02; Mon, 8)
@ 2017-05-08  7:48 Junio C Hamano
  2017-05-08 14:54 ` Enabling the diff "indent" heuristic by default Marc Branchaud
  0 siblings, 1 reply; 14+ messages in thread
From: Junio C Hamano @ 2017-05-08  7:48 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with
'-' are only in 'pu' (proposed updates) while commits prefixed with
'+' are in 'next'.  The ones marked with '.' do not appear in any of
the integration branches, but I am still holding onto them.

You can find the changes described here in the integration branches
of the repositories listed at

    http://git-blame.blogspot.com/p/git-public-repositories.html

--------------------------------------------------
[Graduated to "master"]

* ja/i18n-cleanup (2017-05-01) 2 commits
  (merged to 'next' on 2017-04-30 at 8002e53820)
 + i18n: read-cache: typofix
 + i18n: remove i18n from tag reflog message


* rg/a-the-typo (2017-05-01) 1 commit
  (merged to 'next' on 2017-04-30 at a648cf2961)
 + fix minor typos

 Typofix.


* rg/doc-pull-typofix (2017-05-01) 1 commit
  (merged to 'next' on 2017-04-30 at c2edb4d813)
 + doc: git-pull.txt use US spelling, fix minor typo


* rg/doc-submittingpatches-wordfix (2017-05-01) 1 commit
  (merged to 'next' on 2017-04-30 at 4065036588)
 + doc: update SubmittingPatches


* sr/hooks-cwd-doc (2017-05-01) 1 commit
  (merged to 'next' on 2017-04-30 at 063dd5cb02)
 + githooks.txt: clarify push hooks are always executed in $GIT_DIR

--------------------------------------------------
[New Topics]

* jn/clone-add-empty-config-from-command-line (2017-05-02) 1 commit
 - clone: handle empty config values in -c

 "git clone --config var=val" is a way to populate the
 per-repository configuration file of the new repository, but it did
 not work well when val is an empty string.  This has been fixed.

 Will merge to 'next'.


* jn/credential-doc-on-clear (2017-05-02) 1 commit
 - credential doc: make multiple-helper behavior more prominent

 Doc update.

 Will merge to 'next'.


* sb/checkout-recurse-submodules (2017-05-04) 3 commits
 - submodule: properly recurse for read-tree and checkout
 - submodule: avoid auto-discovery in new working tree manipulator code
 - submodule_move_head: reuse child_process structure for futher commands

 "git checkout --recurse-submodules" did not quite work with a
 submodule that itself has submodules. 

 Will merge to 'next'.


* ab/aix-needs-compat-regex (2017-05-04) 1 commit
 - config.mak.uname: set NO_REGEX=NeedsStartEnd on AIX

 Build fix.

 Will merge to 'next'.


* ja/do-not-ask-needless-questions (2017-05-04) 3 commits
 - git-filter-branch: make the error msg when missing branch more open
 - read-tree -m: make error message for merging 0 trees less smart aleck
 - usability: don't ask questions if no reply is required

 Git sometimes gives an advice in a rhetorical question that does
 not require an answer, which can confuse new users and non native
 speakers.  Attempt to rephrase them.

 I lost track of the discussion on this topic.  Did we decide that
 this is not a good idea?


* ab/doc-replace-gmane-links (2017-05-08) 2 commits
 - SQAUSH???
 - doc: replace a couple of broken gmane links

 The Web interface to gmane news archive is long gone, even though
 the articles are still accessible via NTTP.  Replace the links with
 ones to public-inbox.org.  Because their message identification is
 based on the actual message-id, it is likely that it will be easier
 to migrate away from it if/when necessary.


* ab/fix-poison-tests (2017-05-08) 3 commits
 - travis-ci: add job to run tests with GETTEXT_POISON
 - travis-ci: setup "prove cache" in "script" step
 - tests: fix tests broken under GETTEXT_POISON=YesPlease

 Update tests to pass under GETTEXT_POISON (a mechanism to ensure
 that output strings that should not be translated are not
 translated by mistake), and tell TravisCI to run them.

 Will merge to 'next' after a few rounds on 'pu'.


* bw/dir-c-stops-relying-on-the-index (2017-05-06) 14 commits
 - dir: convert fill_directory to take an index
 - dir: convert read_directory to take an index
 - dir: convert read_directory_recursive to take an index
 - dir: convert open_cached_dir to take an index
 - dir: convert is_excluded to take an index
 - dir: convert prep_exclude to take an index
 - dir: convert add_excludes to take an index
 - dir: convert is_excluded_from_list to take an index
 - dir: convert last_exclude_matching_from_list to take an index
 - dir: convert dir_add* to take an index
 - dir: convert get_dtype to take index
 - dir: convert directory_exists_in_index to take index
 - dir: convert read_skip_worktree_file_from_index to take an index
 - dir: stop using the index compatibility macros

 API update.

 Will merge to 'next'.


* jk/diff-submodule-diff-inline (2017-05-08) 1 commit
 - diff: recurse into nested submodules for inline diff

 "git diff --submodule=diff" didn't recurse into nested submodules.


* jk/disable-pack-reuse-when-broken (2017-05-08) 1 commit
 - pack-objects: disable pack reuse for object-selection options

 "pack-objects" can stream a slice of an existing packfile out when
 the pack bitmap can tell that the reachable objects are all needed
 in the output, without inspecting individual objects.  This
 strategy however would not work well when "--local" and other
 options are in use, and need to be disabled.


* js/eol-on-ourselves (2017-05-08) 7 commits
 - t4051: mark supporting files as requiring LF-only line endings
 - Fix the remaining tests that failed with core.autocrlf=true
 - t4003, t4005, t4007 & t4008: handle CR/LF in t/README & t/diff-lib/README
 - t3901: move supporting files into t/t3901/
 - completion: mark bash script as LF-only
 - git-new-workdir: mark script as LF-only
 - Fix build with core.autocrlf=true

 Make sure our tests would pass when the sources are checked out
 with "platform native" line ending convention by default on
 Windows.  Some "text" files out tests use and the test scripts
 themselves that are meant to be run with /bin/sh, ought to be
 checked out with eol=LF even on Windows.


* nd/split-index-unshare (2017-05-08) 2 commits
 - p3400: add perf tests for rebasing many changes
 - split-index: add and use unshare_split_index()

 Plug some leaks and updates internal API used to implement the
 split index feature to make it easier to avoid such a leak in the
 future.

 Will merge to 'next'.


* rs/checkout-am-fix-unborn (2017-05-08) 2 commits
 - am: check return value of resolve_refdup before using hash
 - checkout: check return value of resolve_refdup before using hash

 A few codepaths in "checkout" and "am" working on an unborn branch
 tried to access an uninitialized piece of memory.

--------------------------------------------------
[Stalled]

* ja/doc-l10n (2017-03-20) 3 commits
 - SQUASH???
 - l10n: add git-add.txt to localized man pages
 - l10n: introduce framework for localizing man pages

 A proposal to use po4a to localize our manual pages.


* sg/clone-refspec-from-command-line-config (2017-02-27) 1 commit
 - clone: respect configured fetch respecs during initial fetch

 Expecting a reroll.
 cf. <20170227211217.73gydlxb2qu2sp3m@sigill.intra.peff.net>
 cf. <CAM0VKj=rsAfKvVccOMOoo5==Q1yW1U0zJBbUV=faKppWFm-u+g@mail.gmail.com>
 Some nits but looks ok.


* sk/dash-is-previous (2017-03-01) 5 commits
 - revert.c: delegate handling of "-" shorthand to setup_revisions
 - sha1_name.c: teach get_sha1_1 "-" shorthand for "@{-1}"
 - revision.c: args starting with "-" might be a revision
 - revision.c: swap if/else blocks
 - revision.c: do not update argv with unknown option

 A dash "-" can be written to mean "the branch that was previously
 checked out" in more places.

 Needs review.
 cf. <1488007487-12965-1-git-send-email-kannan.siddharth12@gmail.com>


* ls/filter-process-delayed (2017-03-06) 1 commit
 - convert: add "status=delayed" to filter process protocol

 What's the status of this one???
 cf. <xmqq60jmnmef.fsf@junio-linux.mtv.corp.google.com>


* pb/bisect (2017-02-18) 28 commits
 . fixup! bisect--helper: `bisect_next_check` & bisect_voc shell function in C
 . bisect--helper: remove the dequote in bisect_start()
 . bisect--helper: retire `--bisect-auto-next` subcommand
 . bisect--helper: retire `--bisect-autostart` subcommand
 . bisect--helper: retire `--bisect-write` subcommand
 . bisect--helper: `bisect_replay` shell function in C
 . bisect--helper: `bisect_log` shell function in C
 . bisect--helper: retire `--write-terms` subcommand
 . bisect--helper: retire `--check-expected-revs` subcommand
 . bisect--helper: `bisect_state` & `bisect_head` shell function in C
 . bisect--helper: `bisect_autostart` shell function in C
 . bisect--helper: retire `--next-all` subcommand
 . bisect--helper: retire `--bisect-clean-state` subcommand
 . bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C
 . t6030: no cleanup with bad merge base
 . bisect--helper: `bisect_start` shell function partially in C
 . bisect--helper: `get_terms` & `bisect_terms` shell function in C
 . bisect--helper: `bisect_next_check` & bisect_voc shell function in C
 . bisect--helper: `check_and_set_terms` shell function in C
 . bisect--helper: `bisect_write` shell function in C
 . bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C
 . bisect--helper: `bisect_reset` shell function in C
 . wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()
 . t6030: explicitly test for bisection cleanup
 . bisect--helper: `bisect_clean_state` shell function in C
 . bisect--helper: `write_terms` shell function in C
 . bisect: rewrite `check_term_format` shell function in C
 . bisect--helper: use OPT_CMDMODE instead of OPT_BOOL

 Move more parts of "git bisect" to C.

 Ejected from 'pu', as it overlaps and gets in the way of bc/object-id topic.
 Expecting a reroll.
 cf. <CAFZEwPPXPPHi8KiEGS9ggzNHDCGhuqMgH9Z8-Pf9GLshg8+LPA@mail.gmail.com>
 cf. <CAFZEwPM9RSTGN54dzaw9gO9iZmsYjJ_d1SjUD4EzSDDbmh-XuA@mail.gmail.com>
 cf. <CAFZEwPNUXcNY9Qdz=_B7q2kQuaecPzJtTMGdv8YMUPEz2vnp8A@mail.gmail.com>


* sh/grep-tree-obj-tweak-output (2017-01-20) 2 commits
 - grep: use '/' delimiter for paths
 - grep: only add delimiter if there isn't one already

 "git grep", when fed a tree-ish as an input, shows each hit
 prefixed with "<tree-ish>:<path>:<lineno>:".  As <tree-ish> is
 almost always either a commit or a tag that points at a commit, the
 early part of the output "<tree-ish>:<path>" can be used as the
 name of the blob and given to "git show".  When <tree-ish> is a
 tree given in the extended SHA-1 syntax (e.g. "<commit>:", or
 "<commit>:<dir>"), however, this results in a string that does not
 name a blob (e.g. "<commit>::<path>" or "<commit>:<dir>:<path>").
 "git grep" has been taught to be a bit more intelligent about these
 cases and omit a colon (in the former case) or use slash (in the
 latter case) to produce "<commit>:<path>" and
 "<commit>:<dir>/<path>" that can be used as the name of a blob.

 Expecting a reroll?  Is this good enough with known limitations?


* jc/diff-b-m (2015-02-23) 5 commits
 . WIPWIP
 . WIP: diff-b-m
 - diffcore-rename: allow easier debugging
 - diffcore-rename.c: add locate_rename_src()
 - diffcore-break: allow debugging

 "git diff -B -M" produced incorrect patch when the postimage of a
 completely rewritten file is similar to the preimage of a removed
 file; such a resulting file must not be expressed as a rename from
 other place.

 The fix in this patch is broken, unfortunately.

 Will discard.

--------------------------------------------------
[Cooking]

* bw/submodule-with-bs-path (2017-05-01) 1 commit
 - t7400: add !CYGWIN prerequisite to 'add with \\ in path'

 A hotfix to a topic that is already in 'master'.

 Wait for a few days for Acks and then merge to 'master'.


* jk/am-leakfix (2017-04-27) 3 commits
  (merged to 'next' on 2017-04-30 at 78becd7a96)
 + am: shorten ident_split variable name in get_commit_info()
 + am: simplify allocations in get_commit_info()
 + am: fix commit buffer leak in get_commit_info()

 The codepath in "git am" that is used when running "git rebase"
 leaked memory held for the log message of the commits being rebased.

 Will cook in 'next'.


* js/plug-leaks (2017-05-08) 26 commits
 - fixup! checkout: fix memory leak
 - submodule_uses_worktrees(): plug memory leak
 - show_worktree(): plug memory leak
 - name-rev: avoid leaking memory in the `deref` case
 - remote: plug memory leak in match_explicit()
 - add_reflog_for_walk: avoid memory leak
 - shallow: avoid memory leak
 - line-log: avoid memory leak
 - receive-pack: plug memory leak in update()
 - fast-export: avoid leaking memory in handle_tag()
 - mktree: plug memory leaks reported by Coverity
 - pack-redundant: plug memory leak
 - setup_discovered_git_dir(): plug memory leak
 - setup_bare_git_dir(): help static analysis
 - split_commit_in_progress(): simplify & fix memory leak
 - checkout: fix memory leak
 - cat-file: fix memory leak
 - mailinfo & mailsplit: check for EOF while parsing
 - status: close file descriptor after reading git-rebase-todo
 - difftool: address a couple of resource/memory leaks
 - get_mail_commit_oid(): avoid resource leak
 - git_config_rename_section_in_file(): avoid resource leak
 - add_commit_patch_id(): avoid allocating memory unnecessarily
 - winansi: avoid buffer overrun
 - winansi: avoid use of uninitialized value
 - mingw: avoid memory leak when splitting PATH

 Fix memory leaks pointed out by Coverity.

 All looked sensible.


* sk/status-short-branch-color-config (2017-04-28) 2 commits
  (merged to 'next' on 2017-04-30 at 2a7eb05d7b)
 + status: add color config slots for branch info in "--short --branch"
 + status: fix missing newline when comment chars are disabled

 The colors in which "git status --short --branch" showed the names
 of the current branch and its remote-tracking branch are now
 configurable.

 Will cook in 'next'.


* jh/close-index-before-stat (2017-04-28) 1 commit
  (merged to 'next' on 2017-04-30 at 918d4f3378)
 + read-cache: close index.lock in do_write_index

 The timestamp of the index file is now taken after the file is
 closed, to help Windows, on which a stale timestamp is reported by
 fstat() on a file that is opened for writing and data was written
 but not yet closed.

 Will cook in 'next'.


* bw/submodule-has-commits-update (2017-05-02) 6 commits
  (merged to 'next' on 2017-05-08 at 57267f2277)
 + submodule: refactor logic to determine changed submodules
 + submodule: improve submodule_has_commits()
 + submodule: change string_list changed_submodule_paths
 + submodule: remove add_oid_to_argv()
 + submodule: rename free_submodules_sha1s()
 + submodule: rename add_sha1_to_array()

 Code clean-up and duplicate removal.

 Will cook in 'next'.


* ls/travis-relays-for-windows-ci (2017-05-04) 2 commits
 - travis-ci: retry if Git for Windows CI returns HTTP error 502 or 503
 - travis-ci: handle Git for Windows CI status "failed" explicitly

 Will merge to 'next' after a few CI run in 'pu'.


* mb/diff-default-to-indent-heuristics (2017-05-02) 4 commits
  (merged to 'next' on 2017-05-08 at 158f401a92)
 + 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

 Make the "indent" heuristics the default in "diff" and diff.indentHeuristics
 configuration variable an escape hatch for those who do no want it.

 Will cook in 'next'.


* tb/dedup-crlf-tests (2017-05-01) 1 commit
 - t0027: Some tests are not expensive

 Will be rerolled.


* jc/repack-threads (2017-04-27) 1 commit
 - repack: accept --threads=<n> and pass it down to pack-objects

 "git repack" learned to accept the --threads=<n> option and pass it
 to pack-objects.


* jh/verify-index-checksum-only-in-fsck (2017-04-27) 1 commit
  (merged to 'next' on 2017-04-28 at afb4c70061)
 + t1450: avoid use of "sed" on the index, which is a binary file

 Update an unportable constructin a new test.

 Will cook in 'next'.


* dt/gc-ignore-old-gc-logs (2017-04-24) 3 commits
  (merged to 'next' on 2017-04-26 at 4f4cab8368)
 + test-lib: retire $remove_trash variable
 + test-lib.sh: do not barf under --debug at the end of the test
 + test-lib: abort when can't remove trash directory

 An attempt to allow us notice "fishy" situation where we fail to
 remove the temporary directory used during the test.

 Will cook in 'next'.


* nd/fopen-errors (2017-05-04) 21 commits
 - t1308: add a test case on open a config directory
 - config.c: handle error on failing to fopen()
 - xdiff-interface.c: report errno on failure to stat() or fopen()
 - wt-status.c: report error on failure to fopen()
 - server-info: report error on failure to fopen()
 - sequencer.c: report error on failure to fopen()
 - rerere.c: report correct errno
 - rerere.c: report error on failure to fopen()
 - remote.c: report error on failure to fopen()
 - commit.c: report error on failure to fopen() the graft file
 - log: fix memory leak in open_next_file()
 - log: report errno on failure to fopen() a file
 - blame: report error on open if graft_file is a directory
 - bisect: report on fopen() error
 - ident.c: use fopen_or_warn()
 - attr.c: use fopen_or_warn()
 - wrapper.c: add fopen_or_warn()
 - wrapper.c: add warn_on_fopen_errors()
 - config.mak.uname: set FREAD_READS_DIRECTORIES for Linux and FreeBSD
 - clone: use xfopen() instead of fopen()
 - Use xfopen() in more places

 We often try to open a file for reading whose existence is
 optional, and silently ignore errors from open/fopen; report such
 errors if they are not due to missing files.

 Need to resurrect "git_fopen: fix a sparse 'not declared' warning".
 It also seems to cause a test failure on MacOS X.
 e.g. https://travis-ci.org/git/git/jobs/229585099#L3091


* dt/raise-core-packed-git-limit (2017-04-20) 1 commit
  (merged to 'next' on 2017-04-26 at c72dd8c62f)
 + Increase core.packedGitLimit

 Raise the default packed-git limit value on larger platforms to
 avoid "git fetch" from a (recoverable) failure while "gc" is
 running in parallel.

 Will cook in 'next'.


* js/larger-timestamps (2017-05-04) 9 commits
 - archive-tar: fix a sparse 'constant too large' warning
  (merged to 'next' on 2017-04-28 at b56a0d38cd)
 + use uintmax_t for timestamps
 + date.c: abort if the system time cannot handle one of our timestamps
 + timestamp_t: a new data type for timestamps
 + PRItime: introduce a new "printf format" for timestamps
 + parse_timestamp(): specify explicitly where we parse timestamps
 + t0006 & t5000: skip "far in the future" test when time_t is too limited
 + t0006 & t5000: prepare for 64-bit timestamps
 + ref-filter: avoid using `unsigned long` for catch-all data type

 Some platforms have ulong that is smaller than time_t, and our
 historical use of ulong for timestamp would mean they cannot
 represent some timestamp that the platform allows.  Invent a
 separate and dedicated timestamp_t (so that we can distingiuish
 timestamps and a vanilla ulongs, which along is already a good
 move), and then declare uintmax_t is the type to be used as the
 timestamp_t

 The tip one from Ramsay needs to be replaced with a newer one.
 cf. <70b431dc-c5cc-e376-b63e-6a58ee1385f1@ramsayjones.plus.com>
 Will cook in 'next'.


* ab/grep-pcre-v2 (2017-05-02) 19 commits
 - Makefile & configure: make PCRE v2 the default PCRE implementation
 - grep: remove support for concurrent use of both PCRE v1 & v2
 - grep: add support for PCRE v2
 - grep: add support for the PCRE v1 JIT API
 - perf: add a performance comparison test of grep -E and -P
 - grep: change the internal PCRE code & header names to be PCRE1
 - grep: change the internal PCRE macro names to be PCRE1
 - test-lib: rename the LIBPCRE prerequisite to PCRE
 - grep: make grep.patternType=[pcre|pcre1] a synonym for "perl"
 - grep & rev-list doc: stop promising libpcre for --perl-regexp
 - log: add -P as a synonym for --perl-regexp
 - log: add exhaustive tests for pattern style options & config
 - grep: add a test for backreferences in PCRE patterns
 - Makefile & configure: reword outdated comment about PCRE
 - grep: remove redundant `regflags &= ~REG_EXTENDED` assignments
 - grep: remove redundant regflags assignment under PCRE
 - grep: submodule-related case statements should die if new fields are added
 - grep: add tests for grep pattern types being passed to submodules
 - grep: amend submodule recursion test in preparation for rx engine testing

 PCRE2, which has an API different from and incompatible with PCRE,
 can now be chosen to support "grep -P -e '<pattern>'" and friends.


* bc/object-id (2017-05-08) 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
 - log-tree: convert to struct object_id
 - Convert lookup_tree to struct object_id
 - builtin/reflog: convert tree_is_complete to take struct object_id
 - tree: convert read_tree_1 to use struct object_id internally
 - Convert lookup_blob to struct object_id
 - Convert remaining callers of lookup_blob to object_id
 - builtin/unpack-objects: convert to struct object_id
 - pack: convert struct pack_idx_entry to struct object_id
 - Convert lookup_commit* to struct object_id
 - Convert remaining callers of lookup_commit_reference* to object_id
 - builtin/tag: convert to struct object_id
 - sequencer: convert some functions to struct object_id
 - shallow: convert shallow registration functions to object_id
 - revision: convert prepare_show_merge to struct object_id
 - notes-utils: convert internals to struct object_id
 - http-push: convert some static functions to struct object_id
 - tag: convert parse_tag_buffer to struct object_id
 - builtin/verify-commit: convert to struct object_id
 - reflog_expire: convert to struct object_id
 - parse-options-cb: convert to struct object_id
 - notes-cache: convert to struct object_id
 - submodule: convert merge_submodule to use struct object_id
 - fast-import: convert to struct object_id
 - fast-import: convert internal structs to struct object_id
 - builtin/rev-parse: convert to struct object_id
 - builtin/blame: convert static function to struct object_id
 - branch: convert to struct object_id
 - bundle: convert to struct object_id
 - builtin/prune: convert to struct object_id
 - builtin/name-rev: convert to struct object_id
 - Convert struct cache_tree to use struct object_id
 - Clean up outstanding object_id transforms.
 - fetch-pack: convert to struct object_id

 Conversion from uchar[20] to struct object_id continues.

 Will merge to 'next'.


* jk/no-null-sha1-in-cache-tree (2017-04-23) 1 commit
  (merged to 'next' on 2017-04-26 at 45fbe9d57d)
 + cache-tree: reject entries with null sha1

 Tighten code to update cache-tree so that we won't accidentally
 write out any 0{40} entry in the tree object.

 Will cook in 'next'.


* rs/large-zip (2017-05-01) 7 commits
  (merged to 'next' on 2017-05-02 at a03574e49b)
 + t5004: require 64-bit support for big ZIP tests
 + archive-zip: set version field for big files correctly
  (merged to 'next' on 2017-04-26 at a6beab60f2)
 + archive-zip: support files bigger than 4GB
 + archive-zip: support archives bigger than 4GB
 + archive-zip: write ZIP dir entry directly to strbuf
 + archive-zip: use strbuf for ZIP directory
 + archive-zip: add tests for big ZIP archives

 "git archive --format=zip" learned to use zip64 extension when
 necessary to go beyond the 4GB limit.

 Will cook in 'next'.


* jc/checkout-working-tree-only (2017-04-27) 1 commit
 - checkout: add --working-tree-only option

 "git checkout <tree-ish> <pathspec>" learned a variant that does
 not update the index when doing its thing.


* js/rebase-i-final (2017-05-02) 10 commits
 - rebase -i: rearrange fixup/squash lines using the rebase--helper
 - t3415: test fixup with wrapped oneline
 - rebase -i: skip unnecessary picks using the rebase--helper
 - rebase -i: check for missing commits in the rebase--helper
 - t3404: relax rebase.missingCommitsCheck tests
 - rebase -i: also expand/collapse the SHA-1s via the rebase--helper
 - rebase -i: do not invent onelines when expanding/collapsing SHA-1s
 - rebase -i: remove useless indentation
 - rebase -i: generate the script via rebase--helper
 - t3415: verify that an empty instructionFormat is handled as before

 The final batch to "git rebase -i" updates to move more code from
 the shell script to C.

 Needs review.


* jt/use-trailer-api-in-commands (2017-04-26) 1 commit
  (merged to 'next' on 2017-04-30 at 006c8d7ebd)
 + sequencer: add newline before adding footers

 "git cherry-pick" and other uses of the sequencer machinery
 mishandled a trailer block whose last line is an incomplete line.
 This has been fixed so that an additional sign-off etc. are added
 after completing the existing incomplete line.

 Will cook in 'next'.


* nd/worktree-move (2017-04-20) 6 commits
 - worktree remove: new command
 - worktree move: refuse to move worktrees with submodules
 - worktree move: accept destination as directory
 - worktree move: new command
 - worktree.c: add update_worktree_location()
 - worktree.c: add validate_worktree()

 "git worktree" learned move and remove subcommands.

 Expecting a reroll.
 cf. <20170420101024.7593-1-pclouds@gmail.com>
 cf. <20170421145916.mknekgqzhxffu7di@sigill.intra.peff.net>
 cf. <d0e81b1e-5869-299e-f462-4d43dc997bd1@ramsayjones.plus.com>


* jk/parse-options-no-no-no (2017-04-25) 2 commits
 - SQUASH???
 - parse-options: disallow double-negations of options starting with no-

 Command line options that begin with "--no-" (e.g. "--no-checkout"
 option of "git clone") can be negated by removing "--no-"; we
 historically also allowed prefixing an extra "no" to the option
 (e.g. "--no-no-checkout"), which made the command line look ugly
 and unusual.  This proposes to forbid it.

 While I agree there is no need to support "--no-no-checkout", this
 looks more like "if it looks ugly and unusual, you do not have to
 use it".  Perhaps we can drop it?

 Will discard.


* df/dir-iter-remove-subtree (2017-04-19) 5 commits
 - remove_subtree(): reimplement using iterators
 - dir_iterator: rewrite state machine model
 - dir_iterator: refactor dir_iterator_advance
 - remove_subtree(): test removing nested directories
 - dir_iterator: add tests for dir_iterator API

 Update the dir-iterator API and use it to reimplement
 remove_subtree().

 A reroll exists that is based on the updated 'master', but I ran
 out of time trying to get it to work with other topics in flight
 in 'pu'.
 GSoC microproject.


* ab/clone-no-tags (2017-05-01) 3 commits
  (merged to 'next' on 2017-04-30 at 601649896a)
 + tests: rename a test having to do with shallow submodules
 + clone: add a --no-tags option to clone without tags
 + tests: change "cd ... && git fetch" to "cd &&\n\tgit fetch"

 "git clone" learned the "--no-tags" option not to fetch all tags
 initially, and also set up the tagopt not to follow any tags in
 subsequent fetches.

 Will cook in 'next'.


* bw/forking-and-threading (2017-04-25) 13 commits
  (merged to 'next' on 2017-04-26 at 89c495e37f)
 + run-command: restrict PATH search to executable files
 + run-command: expose is_executable function
  (merged to 'next' on 2017-04-23 at 7754b5ebc3)
 + run-command: block signals between fork and execve
 + run-command: add note about forking and threading
 + run-command: handle dup2 and close errors in child
 + run-command: eliminate calls to error handling functions in child
 + run-command: don't die in child when duping /dev/null
 + run-command: prepare child environment before forking
 + string-list: add string_list_remove function
 + run-command: use the async-signal-safe execv instead of execvp
 + run-command: prepare command before forking
 + t0061: run_command executes scripts without a #! line
 + t5550: use write_script to generate post-update hook

 The "run-command" API implementation has been made more robust
 against dead-locking in a threaded environment.

 Will cook in 'next'.


* sb/reset-recurse-submodules (2017-04-23) 4 commits
 - builtin/reset: add --recurse-submodules switch
 - submodule.c: submodule_move_head works with broken submodules
 - submodule.c: uninitialized submodules are ignored in recursive commands
 - entry.c: submodule recursing: respect force flag correctly

 "git reset" learned "--recurse-submodules" option.


* ls/travis-doc-asciidoctor (2017-04-26) 4 commits
  (merged to 'next' on 2017-05-04 at 813ba54fc3)
 + travis-ci: check AsciiDoc/AsciiDoctor stderr output
  (merged to 'next' on 2017-04-19 at 359c32953b)
 + travis-ci: unset compiler for jobs that do not need one
 + travis-ci: parallelize documentation build
 + travis-ci: build documentation with AsciiDoc and Asciidoctor

 Have Travis CI format the documentation with both AsciiDoc and
 AsciiDoctor.

 Will cook in 'next'.


* mg/status-in-progress-info (2017-04-14) 1 commit
 - status: show in-progress info for short status

 "git status" learns an option to report various operations
 (e.g. "merging") that the user is in the middle of.

 It is still unclear if the participants decided that it is OK to
 spell "--inprogress" as a single word.


* ab/grep-threading-cleanup (2017-04-16) 8 commits
 - grep: given --threads with NO_PTHREADS=YesPlease, warn
 - pack-objects: fix buggy warning about threads under NO_PTHREADS=YesPlease
 - pack-object & index-pack: add test for --threads warning under NO_PTHREADS
 - tests: add a PTHREADS prerequisite
 - grep: skip pthreads overhead when using one thread
 - grep: don't redundantly compile throwaway patterns under threading
 - grep: add tests for --threads=N and grep.threads
 - grep: assert that threading is enabled when calling grep_{lock,unlock}

 Code cleanup.

 Needs review.


* bp/sub-process-convert-filter (2017-05-08) 10 commits
 - convert: update subprocess_read_status() to not die on EOF
 - sub-process: move sub-process functions into separate files
 - convert: rename reusable sub-process functions
 - convert: update generic functions to only use generic data structures
 - convert: separate generic structures and variables from the filter specific ones
 - convert: split start_multi_file_filter() into two separate functions
 - convert: move packet_write_line() into pkt-line as packet_writel()
 - pkt-line: add packet_read_line_gently()
 - pkt-line: fix packet_read_line() to handle len < 0 errors
 - convert: remove erroneous tests for errno == EPIPE

 Code from "conversion using external process" codepath has been
 extracted to a separate sub-process.[ch] module.

 Will merge to 'next'.


* mg/name-rev-debug (2017-03-31) 4 commits
 - describe: pass --debug down to name-rev
 - name-rev: provide debug output
 - name-rev: favor describing with tags and use committer date to tiebreak
 - name-rev: refactor logic to see if a new candidate is a better name

 "git describe --debug --contains" did not add any meaningful
 information, even though without "--contains" it did.

 Expecting a reroll of the tip two.
 cf. <xmqqshltxnwt.fsf@gitster.mtv.corp.google.com>


* nd/prune-in-worktree (2017-04-24) 12 commits
 - rev-list: expose and document --single-worktree
 - revision.c: --reflog add HEAD reflog from all worktrees
 - files-backend: make reflog iterator go through per-worktree reflog
 - revision.c: --all adds HEAD from all worktrees
 - refs: remove dead for_each_*_submodule()
 - revision.c: use refs_for_each*() instead of for_each_*_submodule()
 - refs: add refs_head_ref()
 - refs: move submodule slash stripping code to get_submodule_ref_store
 - refs.c: refactor get_submodule_ref_store(), share common free block
 - revision.c: --indexed-objects add objects from all worktrees
 - revision.c: refactor add_index_objects_to_pending()
 - revision.h: new flag in struct rev_info wrt. worktree-related refs
 (this branch uses nd/worktree-kill-parse-ref.)

 "git gc" and friends when multiple worktrees are used off of a
 single repository did not consider the index and per-worktree refs
 of other worktrees as the root for reachability traversal, making
 objects that are in use only in other worktrees to be subject to
 garbage collection.

 Expecting a reroll.
 Waiting for nd/worktree-kill-parse-ref to settle.
 cf. <CACsJy8ADCVBiLoPg_Tz0L6CMdh_eFmK4RYzfQ-PmUgBK7w9e=A@mail.gmail.com>


* nd/worktree-kill-parse-ref (2017-04-24) 6 commits
  (merged to 'next' on 2017-04-26 at b8e40da709)
 + refs: kill set_worktree_head_symref()
 + worktree.c: kill parse_ref() in favor of refs_resolve_ref_unsafe()
 + refs: introduce get_worktree_ref_store()
 + refs: add REFS_STORE_ALL_CAPS
 + refs.c: make submodule ref store hashmap generic
 + environment.c: fix potential segfault by get_git_common_dir()
 (this branch is used by nd/prune-in-worktree.)

 "git gc" did not interact well with "git worktree"-managed
 per-worktree refs.

 Will cook in 'next'.


* jc/bundle (2016-03-03) 6 commits
 - index-pack: --clone-bundle option
 - Merge branch 'jc/index-pack' into jc/bundle
 - bundle v3: the beginning
 - bundle: keep a copy of bundle file name in the in-core bundle header
 - bundle: plug resource leak
 - bundle doc: 'verify' is not about verifying the bundle

 The beginning of "split bundle", which could be one of the
 ingredients to allow "git clone" traffic off of the core server
 network to CDN.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Enabling the diff "indent" heuristic by default
  2017-05-08  7:48 What's cooking in git.git (May 2017, #02; Mon, 8) Junio C Hamano
@ 2017-05-08 14:54 ` Marc Branchaud
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
  2017-05-09  3:20   ` Enabling the diff "indent" heuristic by default Jeff King
  0 siblings, 2 replies; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 14:54 UTC (permalink / raw)
  To: Junio C Hamano, git
  Cc: Jeff King, Stefan Beller, Ævar Arnfjörð Bjarmason,
	Michael Haggerty

On 2017-05-08 03:48 AM, Junio C Hamano wrote:
>
> * mb/diff-default-to-indent-heuristics (2017-05-02) 4 commits
>   (merged to 'next' on 2017-05-08 at 158f401a92)

I think there's a general open question about this, which is whether or 
not we should just drop the diff.indentHeuristic configuration setting 
altogether.

Peff made the point [0] that if we keep the setting then t4061 should be 
rewritten.

My instinct is to keep the setting, at least until the changed default 
has a bit of time to settle in.  So I'll re-send the topic with the 
renovated t4061.

The topic would of course change more drastically if we decide to drop 
the setting right away.

>  + 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
>
>  Make the "indent" heuristics the default in "diff" and diff.indentHeuristics

s/heuristics/heuristic/  (both places)

>  configuration variable an escape hatch for those who do no want it.

s/do no/do not/

>  Will cook in 'next'.

Both Peff [1] and Ævar [2] mentioned situations where enabling the 
heuristic has a small impact on them.  If/when this graduates, it's 
perhaps worth adding a backward-compatibility note that the default 
patch IDs are changing.  Maybe something like:

The diff "indent" heuristic is now enabled by default.  This changes the 
patch IDs calculated by git-patch-id and used by git-cherry, which could 
affect patch-based workflows that rely on previously-computed patch IDs. 
  The heuristic can be disabled by setting diff.indentHeuristic to false.

[0] 
https://public-inbox.org/git/20170501222051.svylxazjwnot3wwg@sigill.intra.peff.net/

[1] 
https://public-inbox.org/git/20170428220450.olqitnuwhrxzg3pv@sigill.intra.peff.net/

[2] 
https://public-inbox.org/git/CACBZZX5f81HKCjRjTDyXzNMVuef9Z_ECS+0SVk2xpbwXudgxCw@mail.gmail.com/

		M.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic.
  2017-05-08 14:54 ` Enabling the diff "indent" heuristic by default Marc Branchaud
@ 2017-05-08 16:03   ` Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration Marc Branchaud
                       ` (5 more replies)
  2017-05-09  3:20   ` Enabling the diff "indent" heuristic by default Jeff King
  1 sibling, 6 replies; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 16:03 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Jeff King, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

The only change from v3 is in 3/4, to expand t4061 to test various
combinations of --(no-)indent-heuristic and diff.indentHeuristic.

I kindof went all-in and tried to cover every possible combination for
all four affected commands.

An inter-diff is below.

		M.

Jeff King (1):
  add--interactive: drop diff.indentHeuristic handling

Marc Branchaud (2):
  diff: make the indent heuristic part of diff's basic configuration
  diff: have the diff-* builtins configure diff before initializing
    revisions

Stefan Beller (1):
  diff: enable indent heuristic by default

 builtin/diff-files.c             |   2 +-
 builtin/diff-index.c             |   2 +-
 builtin/diff-tree.c              |   2 +-
 diff.c                           |   8 +-
 git-add--interactive.perl        |   4 -
 t/t4051-diff-function-context.sh |   3 +-
 t/t4061-diff-indent.sh           | 184 +++++++++++++++++++++++++++++++++++----
 7 files changed, 177 insertions(+), 28 deletions(-)


diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 56d7d7760..2affd7a10 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -152,26 +152,28 @@ test_expect_success 'prepare' '
 	EOF
 '
 
+# --- diff tests ----------------------------------------------------------
+
 test_expect_success 'diff: ugly spaces' '
 	git diff --no-indent-heuristic old new -- spaces.txt >out &&
 	compare_diff spaces-expect out
 '
 
+test_expect_success 'diff: --no-indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
+	compare_diff spaces-expect out2
+'
+
 test_expect_success 'diff: nice spaces with --indent-heuristic' '
-	git diff --indent-heuristic old new -- spaces.txt >out-compacted &&
+	git -c diff.indentHeuristic=false diff --indent-heuristic old new -- spaces.txt >out-compacted &&
 	compare_diff spaces-compacted-expect out-compacted
 '
 
-test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff old new -- spaces.txt >out-compacted2 &&
 	compare_diff spaces-compacted-expect out-compacted2
 '
 
-test_expect_success 'diff: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
-	compare_diff spaces-expect out2
-'
-
 test_expect_success 'diff: --indent-heuristic with --patience' '
 	git diff --indent-heuristic --patience old new -- spaces.txt >out-compacted3 &&
 	compare_diff spaces-compacted-expect out-compacted3
@@ -192,42 +194,73 @@ test_expect_success 'diff: nice functions with --indent-heuristic' '
 	compare_diff functions-compacted-expect out-compacted
 '
 
-test_expect_success 'blame: ugly spaces' '
-	git blame --no-indent-heuristic old..new -- spaces.txt >out-blame &&
-	compare_blame spaces-expect out-blame
-'
+# --- blame tests ---------------------------------------------------------
 
 test_expect_success 'blame: nice spaces with --indent-heuristic' '
 	git blame --indent-heuristic old..new -- spaces.txt >out-blame-compacted &&
 	compare_blame spaces-compacted-expect out-blame-compacted
 '
 
-test_expect_success 'blame: nice spaces with diff.indentHeuristic' '
+test_expect_success 'blame: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true blame old..new -- spaces.txt >out-blame-compacted2 &&
 	compare_blame spaces-compacted-expect out-blame-compacted2
 '
 
+test_expect_success 'blame: ugly spaces with --no-indent-heuristic' '
+	git blame --no-indent-heuristic old..new -- spaces.txt >out-blame &&
+	compare_blame spaces-expect out-blame
+'
+
+test_expect_success 'blame: ugly spaces with diff.indentHeuristic=false' '
+	git -c diff.indentHeuristic=false blame old..new -- spaces.txt >out-blame2 &&
+	compare_blame spaces-expect out-blame2
+'
+
 test_expect_success 'blame: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true blame --no-indent-heuristic old..new -- spaces.txt >out-blame2 &&
+	git -c diff.indentHeuristic=true blame --no-indent-heuristic old..new -- spaces.txt >out-blame3 &&
 	git blame old..new -- spaces.txt >out-blame &&
-	compare_blame spaces-expect out-blame2
+	compare_blame spaces-expect out-blame3
 '
 
+test_expect_success 'blame: --indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=false blame --indent-heuristic old..new -- spaces.txt >out-blame-compacted3 &&
+	compare_blame spaces-compacted-expect out-blame-compacted2
+'
+
+# --- diff-tree tests -----------------------------------------------------
+
 test_expect_success 'diff-tree: nice spaces with --indent-heuristic' '
 	git diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted &&
 	compare_diff spaces-compacted-expect out-diff-tree-compacted
 '
 
-test_expect_success 'diff-tree: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-tree: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff-tree -p old new -- spaces.txt >out-diff-tree-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-tree-compacted2
 '
 
-test_expect_success 'diff-tree: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
+test_expect_success 'diff-tree: ugly spaces with --no-indent-heuristic' '
+	git diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
 	compare_diff spaces-expect out-diff-tree
 '
 
+test_expect_success 'diff-tree: ugly spaces with diff.indentHeuristic=false' '
+	git -c diff.indentHeuristic=false diff-tree -p old new -- spaces.txt >out-diff-tree2 &&
+	compare_diff spaces-expect out-diff-tree2
+'
+
+test_expect_success 'diff-tree: --indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=false diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted3 &&
+	compare_diff spaces-compacted-expect out-diff-tree-compacted3
+'
+
+test_expect_success 'diff-tree: --no-indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree3 &&
+	compare_diff spaces-expect out-diff-tree3
+'
+
+# --- diff-index tests ----------------------------------------------------
+
 test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
@@ -236,7 +269,7 @@ test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git checkout -f master
 '
 
-test_expect_success 'diff-index: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
@@ -244,24 +277,50 @@ test_expect_success 'diff-index: nice spaces with diff.indentHeuristic' '
 	git checkout -f master
 '
 
-test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
+test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
-	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
+	git diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
 	compare_diff spaces-expect out-diff-index &&
 	git checkout -f master
 '
 
-test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=false diff-index -p old -- spaces.txt >out-diff-index2 &&
+	compare_diff spaces-expect out-diff-index2 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: --indent-heuristic overrides config' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=false diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted3 &&
+	compare_diff spaces-compacted-expect out-diff-index-compacted3 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index3 &&
+	compare_diff spaces-expect out-diff-index3 &&
+	git checkout -f master
+'
+
+# --- diff-files tests ----------------------------------------------------
+
+test_expect_success 'diff-files: nice spaces with --indent-heuristic' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
-	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw &&
+	git diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
 	git checkout -f master
 '
 
-test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
 	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
@@ -270,11 +329,38 @@ test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
 	git checkout -f master
 '
 
+test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw &&
+	grep -v index out-diff-files-raw >out-diff-files &&
+	compare_diff spaces-expect out-diff-files &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=false diff-files -p spaces.txt >out-diff-files-raw2 &&
+	grep -v index out-diff-files-raw2 >out-diff-files &&
+	compare_diff spaces-expect out-diff-files &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: --indent-heuristic overrides config' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=false diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
+	grep -v index out-diff-files-raw3 >out-diff-files-compacted &&
+	compare_diff spaces-compacted-expect out-diff-files-compacted &&
+	git checkout -f master
+'
+
 test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
-	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
-	grep -v index out-diff-files-raw3 >out-diff-files &&
+	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw4 &&
+	grep -v index out-diff-files-raw4 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
 	git checkout -f master
 '

-- 
2.13.0.rc1.15.gf67d331ad

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
@ 2017-05-08 16:03     ` Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions Marc Branchaud
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 16:03 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Jeff King, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

This heuristic was originally introduced as an experimental feature,
and therefore part of the UI configuration.

But the user often sees diffs generated by plumbing commands like
diff-tree.  Moving the indent heuristic into diff's basic configuration
prepares the way for diff plumbing commands to respect the setting.

The heuristic itself merely makes the diffs more aesthetically
pleasing, without changing their correctness.  Scripts that rely on
the diff plumbing commands should not care whether or not the heuristic
is employed.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
 diff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diff.c b/diff.c
index 74283d900..b6e3ffe92 100644
--- a/diff.c
+++ b/diff.c
@@ -290,9 +290,6 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
 		return 0;
 	}
 
-	if (git_diff_heuristic_config(var, value, cb) < 0)
-		return -1;
-
 	if (!strcmp(var, "diff.wserrorhighlight")) {
 		int val = parse_ws_error_highlight(value);
 		if (val < 0)
@@ -351,6 +348,9 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
 	if (starts_with(var, "submodule."))
 		return parse_submodule_config_option(var, value);
 
+	if (git_diff_heuristic_config(var, value, cb) < 0)
+		return -1;
+
 	return git_default_config(var, value, cb);
 }
 
-- 
2.13.0.rc1.15.gf67d331ad


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration Marc Branchaud
@ 2017-05-08 16:03     ` Marc Branchaud
  2017-05-09  3:22       ` Jeff King
  2017-05-08 16:03     ` [PATCH v4 3/4] diff: enable indent heuristic by default Marc Branchaud
                       ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 16:03 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Jeff King, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

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>
---
 builtin/diff-files.c   |  2 +-
 builtin/diff-index.c   |  2 +-
 builtin/diff-tree.c    |  2 +-
 t/t4061-diff-indent.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/builtin/diff-files.c b/builtin/diff-files.c
index 15c61fd8d..a572da9d5 100644
--- a/builtin/diff-files.c
+++ b/builtin/diff-files.c
@@ -20,9 +20,9 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
 	int result;
 	unsigned options = 0;
 
+	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	init_revisions(&rev, prefix);
 	gitmodules_config();
-	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	rev.abbrev = 0;
 	precompose_argv(argc, argv);
 
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 1af373d00..f084826a2 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -17,9 +17,9 @@ int cmd_diff_index(int argc, const char **argv, const char *prefix)
 	int i;
 	int result;
 
+	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	init_revisions(&rev, prefix);
 	gitmodules_config();
-	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	rev.abbrev = 0;
 	precompose_argv(argc, argv);
 
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 326f88b65..36a3a1976 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -105,9 +105,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
 	struct setup_revision_opt s_r_opt;
 	int read_stdin = 0;
 
+	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	init_revisions(opt, prefix);
 	gitmodules_config();
-	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 	opt->abbrev = 0;
 	opt->diff = 1;
 	opt->disable_stdin = 1;
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 556450609..13d3dc96a 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -213,4 +213,70 @@ test_expect_success 'blame: --no-indent-heuristic overrides config' '
 	compare_blame spaces-expect out-blame2
 '
 
+test_expect_success 'diff-tree: nice spaces with --indent-heuristic' '
+	git diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted &&
+	compare_diff spaces-compacted-expect out-diff-tree-compacted
+'
+
+test_expect_success 'diff-tree: nice spaces with diff.indentHeuristic' '
+	git -c diff.indentHeuristic=true diff-tree -p old new -- spaces.txt >out-diff-tree-compacted2 &&
+	compare_diff spaces-compacted-expect out-diff-tree-compacted2
+'
+
+test_expect_success 'diff-tree: --no-indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
+	compare_diff spaces-expect out-diff-tree
+'
+
+test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted &&
+	compare_diff spaces-compacted-expect out-diff-index-compacted &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: nice spaces with diff.indentHeuristic' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
+	compare_diff spaces-compacted-expect out-diff-index-compacted2 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
+	compare_diff spaces-expect out-diff-index &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw &&
+	grep -v index out-diff-files-raw >out-diff-files-compacted &&
+	compare_diff spaces-compacted-expect out-diff-files-compacted &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
+	grep -v index out-diff-files-raw2 >out-diff-files-compacted2 &&
+	compare_diff spaces-compacted-expect out-diff-files-compacted2 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
+	grep -v index out-diff-files-raw3 >out-diff-files &&
+	compare_diff spaces-expect out-diff-files &&
+	git checkout -f master
+'
+
 test_done
-- 
2.13.0.rc1.15.gf67d331ad


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 3/4] diff: enable indent heuristic by default
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions Marc Branchaud
@ 2017-05-08 16:03     ` Marc Branchaud
  2017-05-08 16:03     ` [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling Marc Branchaud
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 16:03 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Jeff King, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

From: Stefan Beller <sbeller@google.com>

The feature was included in v2.11 (released 2016-11-29) and we got no
negative feedback. Quite the opposite, all feedback we got was positive.

Turn it on by default. Users who dislike the feature can turn it off
by setting diff.indentHeuristic (which also configures plumbing commands,
see prior patches).

The change to t/t4051-diff-function-context.sh is needed because the
heuristic shifts the changed hunk in the patch.  To get the same result
regardless of the heuristic configuration, we modify the test file
differently:  We insert a completely new line after line 2, instead of
simply duplicating it.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---

 diff.c                           |   2 +-
 t/t4051-diff-function-context.sh |   3 +-
 t/t4061-diff-indent.sh           | 140 +++++++++++++++++++++++++++++++--------
 3 files changed, 116 insertions(+), 29 deletions(-)

diff --git a/diff.c b/diff.c
index b6e3ffe92..a24452051 100644
--- a/diff.c
+++ b/diff.c
@@ -27,7 +27,7 @@
 #endif
 
 static int diff_detect_rename_default;
-static int diff_indent_heuristic; /* experimental */
+static int diff_indent_heuristic = 1;
 static int diff_rename_limit_default = 400;
 static int diff_suppress_blank_empty;
 static int diff_use_color_default = -1;
diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh
index 6154acb45..3e6b485ec 100755
--- a/t/t4051-diff-function-context.sh
+++ b/t/t4051-diff-function-context.sh
@@ -72,7 +72,8 @@ test_expect_success 'setup' '
 
 	# overlap function context of 1st change and -u context of 2nd change
 	grep -v "delete me from hello" <"$dir/hello.c" >file.c &&
-	sed 2p <"$dir/dummy.c" >>file.c &&
+	sed "2a\\
+	     extra line" <"$dir/dummy.c" >>file.c &&
 	commit_and_tag changed_hello_dummy file.c &&
 
 	git checkout initial &&
diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
index 13d3dc96a..2affd7a10 100755
--- a/t/t4061-diff-indent.sh
+++ b/t/t4061-diff-indent.sh
@@ -152,26 +152,28 @@ test_expect_success 'prepare' '
 	EOF
 '
 
+# --- diff tests ----------------------------------------------------------
+
 test_expect_success 'diff: ugly spaces' '
-	git diff old new -- spaces.txt >out &&
+	git diff --no-indent-heuristic old new -- spaces.txt >out &&
 	compare_diff spaces-expect out
 '
 
+test_expect_success 'diff: --no-indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
+	compare_diff spaces-expect out2
+'
+
 test_expect_success 'diff: nice spaces with --indent-heuristic' '
-	git diff --indent-heuristic old new -- spaces.txt >out-compacted &&
+	git -c diff.indentHeuristic=false diff --indent-heuristic old new -- spaces.txt >out-compacted &&
 	compare_diff spaces-compacted-expect out-compacted
 '
 
-test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff old new -- spaces.txt >out-compacted2 &&
 	compare_diff spaces-compacted-expect out-compacted2
 '
 
-test_expect_success 'diff: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
-	compare_diff spaces-expect out2
-'
-
 test_expect_success 'diff: --indent-heuristic with --patience' '
 	git diff --indent-heuristic --patience old new -- spaces.txt >out-compacted3 &&
 	compare_diff spaces-compacted-expect out-compacted3
@@ -183,7 +185,7 @@ test_expect_success 'diff: --indent-heuristic with --histogram' '
 '
 
 test_expect_success 'diff: ugly functions' '
-	git diff old new -- functions.c >out &&
+	git diff --no-indent-heuristic old new -- functions.c >out &&
 	compare_diff functions-expect out
 '
 
@@ -192,42 +194,73 @@ test_expect_success 'diff: nice functions with --indent-heuristic' '
 	compare_diff functions-compacted-expect out-compacted
 '
 
-test_expect_success 'blame: ugly spaces' '
-	git blame old..new -- spaces.txt >out-blame &&
-	compare_blame spaces-expect out-blame
-'
+# --- blame tests ---------------------------------------------------------
 
 test_expect_success 'blame: nice spaces with --indent-heuristic' '
 	git blame --indent-heuristic old..new -- spaces.txt >out-blame-compacted &&
 	compare_blame spaces-compacted-expect out-blame-compacted
 '
 
-test_expect_success 'blame: nice spaces with diff.indentHeuristic' '
+test_expect_success 'blame: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true blame old..new -- spaces.txt >out-blame-compacted2 &&
 	compare_blame spaces-compacted-expect out-blame-compacted2
 '
 
+test_expect_success 'blame: ugly spaces with --no-indent-heuristic' '
+	git blame --no-indent-heuristic old..new -- spaces.txt >out-blame &&
+	compare_blame spaces-expect out-blame
+'
+
+test_expect_success 'blame: ugly spaces with diff.indentHeuristic=false' '
+	git -c diff.indentHeuristic=false blame old..new -- spaces.txt >out-blame2 &&
+	compare_blame spaces-expect out-blame2
+'
+
 test_expect_success 'blame: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true blame --no-indent-heuristic old..new -- spaces.txt >out-blame2 &&
+	git -c diff.indentHeuristic=true blame --no-indent-heuristic old..new -- spaces.txt >out-blame3 &&
 	git blame old..new -- spaces.txt >out-blame &&
-	compare_blame spaces-expect out-blame2
+	compare_blame spaces-expect out-blame3
 '
 
+test_expect_success 'blame: --indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=false blame --indent-heuristic old..new -- spaces.txt >out-blame-compacted3 &&
+	compare_blame spaces-compacted-expect out-blame-compacted2
+'
+
+# --- diff-tree tests -----------------------------------------------------
+
 test_expect_success 'diff-tree: nice spaces with --indent-heuristic' '
 	git diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted &&
 	compare_diff spaces-compacted-expect out-diff-tree-compacted
 '
 
-test_expect_success 'diff-tree: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-tree: nice spaces with diff.indentHeuristic=true' '
 	git -c diff.indentHeuristic=true diff-tree -p old new -- spaces.txt >out-diff-tree-compacted2 &&
 	compare_diff spaces-compacted-expect out-diff-tree-compacted2
 '
 
-test_expect_success 'diff-tree: --no-indent-heuristic overrides config' '
-	git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
+test_expect_success 'diff-tree: ugly spaces with --no-indent-heuristic' '
+	git diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree &&
 	compare_diff spaces-expect out-diff-tree
 '
 
+test_expect_success 'diff-tree: ugly spaces with diff.indentHeuristic=false' '
+	git -c diff.indentHeuristic=false diff-tree -p old new -- spaces.txt >out-diff-tree2 &&
+	compare_diff spaces-expect out-diff-tree2
+'
+
+test_expect_success 'diff-tree: --indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=false diff-tree --indent-heuristic -p old new -- spaces.txt >out-diff-tree-compacted3 &&
+	compare_diff spaces-compacted-expect out-diff-tree-compacted3
+'
+
+test_expect_success 'diff-tree: --no-indent-heuristic overrides config' '
+	git -c diff.indentHeuristic=true diff-tree --no-indent-heuristic -p old new -- spaces.txt >out-diff-tree3 &&
+	compare_diff spaces-expect out-diff-tree3
+'
+
+# --- diff-index tests ----------------------------------------------------
+
 test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
@@ -236,7 +269,7 @@ test_expect_success 'diff-index: nice spaces with --indent-heuristic' '
 	git checkout -f master
 '
 
-test_expect_success 'diff-index: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-index: nice spaces with diff.indentHeuristic=true' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
 	git -c diff.indentHeuristic=true diff-index -p old -- spaces.txt >out-diff-index-compacted2 &&
@@ -244,24 +277,50 @@ test_expect_success 'diff-index: nice spaces with diff.indentHeuristic' '
 	git checkout -f master
 '
 
-test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
+test_expect_success 'diff-index: ugly spaces with --no-indent-heuristic' '
 	git checkout -B diff-index &&
 	git reset --soft HEAD~ &&
-	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
+	git diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index &&
 	compare_diff spaces-expect out-diff-index &&
 	git checkout -f master
 '
 
-test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-index: ugly spaces with diff.indentHeuristic=false' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=false diff-index -p old -- spaces.txt >out-diff-index2 &&
+	compare_diff spaces-expect out-diff-index2 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: --indent-heuristic overrides config' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=false diff-index --indent-heuristic -p old -- spaces.txt >out-diff-index-compacted3 &&
+	compare_diff spaces-compacted-expect out-diff-index-compacted3 &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-index: --no-indent-heuristic overrides config' '
+	git checkout -B diff-index &&
+	git reset --soft HEAD~ &&
+	git -c diff.indentHeuristic=true diff-index --no-indent-heuristic -p old -- spaces.txt >out-diff-index3 &&
+	compare_diff spaces-expect out-diff-index3 &&
+	git checkout -f master
+'
+
+# --- diff-files tests ----------------------------------------------------
+
+test_expect_success 'diff-files: nice spaces with --indent-heuristic' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
-	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw &&
+	git diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw &&
 	grep -v index out-diff-files-raw >out-diff-files-compacted &&
 	compare_diff spaces-compacted-expect out-diff-files-compacted &&
 	git checkout -f master
 '
 
-test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
+test_expect_success 'diff-files: nice spaces with diff.indentHeuristic=true' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
 	git -c diff.indentHeuristic=true diff-files -p spaces.txt >out-diff-files-raw2 &&
@@ -270,11 +329,38 @@ test_expect_success 'diff-files: nice spaces with diff.indentHeuristic' '
 	git checkout -f master
 '
 
+test_expect_success 'diff-files: ugly spaces with --no-indent-heuristic' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw &&
+	grep -v index out-diff-files-raw >out-diff-files &&
+	compare_diff spaces-expect out-diff-files &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: ugly spaces with diff.indentHeuristic=false' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=false diff-files -p spaces.txt >out-diff-files-raw2 &&
+	grep -v index out-diff-files-raw2 >out-diff-files &&
+	compare_diff spaces-expect out-diff-files &&
+	git checkout -f master
+'
+
+test_expect_success 'diff-files: --indent-heuristic overrides config' '
+	git checkout -B diff-files &&
+	git reset HEAD~ &&
+	git -c diff.indentHeuristic=false diff-files --indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
+	grep -v index out-diff-files-raw3 >out-diff-files-compacted &&
+	compare_diff spaces-compacted-expect out-diff-files-compacted &&
+	git checkout -f master
+'
+
 test_expect_success 'diff-files: --no-indent-heuristic overrides config' '
 	git checkout -B diff-files &&
 	git reset HEAD~ &&
-	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw3 &&
-	grep -v index out-diff-files-raw3 >out-diff-files &&
+	git -c diff.indentHeuristic=true diff-files --no-indent-heuristic -p spaces.txt >out-diff-files-raw4 &&
+	grep -v index out-diff-files-raw4 >out-diff-files &&
 	compare_diff spaces-expect out-diff-files &&
 	git checkout -f master
 '
-- 
2.13.0.rc1.15.gf67d331ad


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
                       ` (2 preceding siblings ...)
  2017-05-08 16:03     ` [PATCH v4 3/4] diff: enable indent heuristic by default Marc Branchaud
@ 2017-05-08 16:03     ` Marc Branchaud
  2017-05-09  3:29       ` Jeff King
  2017-05-08 17:13     ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Stefan Beller
  2017-05-09  3:32     ` Jeff King
  5 siblings, 1 reply; 14+ messages in thread
From: Marc Branchaud @ 2017-05-08 16:03 UTC (permalink / raw)
  To: git, Junio C Hamano
  Cc: Jeff King, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

From: Jeff King <peff@peff.net>

Now that diff.indentHeuristic is handled automatically by the plumbing
commands, there's no need to propagate it manually.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
---
 git-add--interactive.perl | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 709a5f6ce..79d675b5b 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -46,7 +46,6 @@ my ($diff_new_color) =
 my $normal_color = $repo->get_color("", "reset");
 
 my $diff_algorithm = $repo->config('diff.algorithm');
-my $diff_indent_heuristic = $repo->config_bool('diff.indentheuristic');
 my $diff_filter = $repo->config('interactive.difffilter');
 
 my $use_readkey = 0;
@@ -730,9 +729,6 @@ sub parse_diff {
 	if (defined $diff_algorithm) {
 		splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
 	}
-	if ($diff_indent_heuristic) {
-		splice @diff_cmd, 1, 0, "--indent-heuristic";
-	}
 	if (defined $patch_mode_revision) {
 		push @diff_cmd, get_diff_reference($patch_mode_revision);
 	}
-- 
2.13.0.rc1.15.gf67d331ad


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic.
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
                       ` (3 preceding siblings ...)
  2017-05-08 16:03     ` [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling Marc Branchaud
@ 2017-05-08 17:13     ` Stefan Beller
  2017-05-09  3:27       ` Jeff King
  2017-05-09  3:32     ` Jeff King
  5 siblings, 1 reply; 14+ messages in thread
From: Stefan Beller @ 2017-05-08 17:13 UTC (permalink / raw)
  To: Marc Branchaud
  Cc: git@vger.kernel.org, Junio C Hamano, Jeff King, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

On Mon, May 8, 2017 at 9:03 AM, Marc Branchaud <marcnarc@xiplink.com> wrote:
> The only change from v3 is in 3/4, to expand t4061 to test various
> combinations of --(no-)indent-heuristic and diff.indentHeuristic.
>
> I kindof went all-in and tried to cover every possible combination for
> all four affected commands.
>
> An inter-diff is below.
>
>                 M.
>
> Jeff King (1):
>   add--interactive: drop diff.indentHeuristic handling
>
> Marc Branchaud (2):
>   diff: make the indent heuristic part of diff's basic configuration
>   diff: have the diff-* builtins configure diff before initializing
>     revisions
>
> Stefan Beller (1):
>   diff: enable indent heuristic by default
>
>  builtin/diff-files.c             |   2 +-
>  builtin/diff-index.c             |   2 +-
>  builtin/diff-tree.c              |   2 +-
>  diff.c                           |   8 +-
>  git-add--interactive.perl        |   4 -
>  t/t4051-diff-function-context.sh |   3 +-
>  t/t4061-diff-indent.sh           | 184 +++++++++++++++++++++++++++++++++++----
>  7 files changed, 177 insertions(+), 28 deletions(-)
>
>
> diff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh
> index 56d7d7760..2affd7a10 100755
> --- a/t/t4061-diff-indent.sh
> +++ b/t/t4061-diff-indent.sh
> @@ -152,26 +152,28 @@ test_expect_success 'prepare' '
>         EOF
>  '
>
> +# --- diff tests ----------------------------------------------------------
> +
>  test_expect_success 'diff: ugly spaces' '
>         git diff --no-indent-heuristic old new -- spaces.txt >out &&
>         compare_diff spaces-expect out
>  '
>
> +test_expect_success 'diff: --no-indent-heuristic overrides config' '
> +       git -c diff.indentHeuristic=true diff --no-indent-heuristic old new -- spaces.txt >out2 &&
> +       compare_diff spaces-expect out2
> +'
> +
>  test_expect_success 'diff: nice spaces with --indent-heuristic' '
> -       git diff --indent-heuristic old new -- spaces.txt >out-compacted &&
> +       git -c diff.indentHeuristic=false diff --indent-heuristic old new -- spaces.txt >out-compacted &&
>         compare_diff spaces-compacted-expect out-compacted
>  '
>
> -test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
> +test_expect_success 'diff: nice spaces with diff.indentHeuristic=true' '

Adding the '=true' seems weird to me (I'd think the true is implied,
similar to C,
where we do "if (!null_pointer)" instead of an explicit "!=null".
However we do have these '=true' sprinkled all over the tests,
so I guess it is a valid dialect in our test suite.

The tests (just looked at the interdiff) look good to me.

Thanks,
Stefan

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Enabling the diff "indent" heuristic by default
  2017-05-08 14:54 ` Enabling the diff "indent" heuristic by default Marc Branchaud
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
@ 2017-05-09  3:20   ` Jeff King
  1 sibling, 0 replies; 14+ messages in thread
From: Jeff King @ 2017-05-09  3:20 UTC (permalink / raw)
  To: Marc Branchaud
  Cc: Junio C Hamano, git, Stefan Beller,
	Ævar Arnfjörð Bjarmason, Michael Haggerty

On Mon, May 08, 2017 at 10:54:10AM -0400, Marc Branchaud wrote:

> On 2017-05-08 03:48 AM, Junio C Hamano wrote:
> > 
> > * mb/diff-default-to-indent-heuristics (2017-05-02) 4 commits
> >   (merged to 'next' on 2017-05-08 at 158f401a92)
> 
> I think there's a general open question about this, which is whether or not
> we should just drop the diff.indentHeuristic configuration setting
> altogether.
> 
> Peff made the point [0] that if we keep the setting then t4061 should be
> rewritten.
> 
> My instinct is to keep the setting, at least until the changed default has a
> bit of time to settle in.  So I'll re-send the topic with the renovated
> t4061.

My instinct matches that, too. It gives people like Ævar, with his
patch-id database, a way to keep compatibility if he chooses. If we were
designing from the ground up, I'd say the option is probably just
clutter, but the backwards compatibility issue means we should probably
keep it around more or less forever.

And since Junio wasn't on the other thread, I'll repeat what I wrote
there:

  I do feel a bit sad about breaking this case (or at the very least
  forcing you to set an option to retain cross-version compatibility).
  But my gut says that we don't want to lock ourselves into never
  changing the diff algorithm (and I'm sure we've done it inadvertently
  a few times over the years; even the recent switch to turning on
  renames would have had that impact).

> Both Peff [1] and Ævar [2] mentioned situations where enabling the heuristic
> has a small impact on them.  If/when this graduates, it's perhaps worth
> adding a backward-compatibility note that the default patch IDs are
> changing.  Maybe something like:
> 
> The diff "indent" heuristic is now enabled by default.  This changes the
> patch IDs calculated by git-patch-id and used by git-cherry, which could
> affect patch-based workflows that rely on previously-computed patch IDs.
> The heuristic can be disabled by setting diff.indentHeuristic to false.

I think a note like this is a good idea.

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions
  2017-05-08 16:03     ` [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions Marc Branchaud
@ 2017-05-09  3:22       ` Jeff King
  2017-05-11 19:22         ` Marc Branchaud
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff King @ 2017-05-09  3:22 UTC (permalink / raw)
  To: Marc Branchaud
  Cc: git, Junio C Hamano, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

On Mon, May 08, 2017 at 12:03:37PM -0400, Marc Branchaud wrote:

> 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.

I don't know if you want to note here that this is only _some_ options.
I.e., ones that we handle by copying via diff_setup(). Maybe it's
obvious from the description already (it's hard for me to tell because I
already know it either way :) ).

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic.
  2017-05-08 17:13     ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Stefan Beller
@ 2017-05-09  3:27       ` Jeff King
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff King @ 2017-05-09  3:27 UTC (permalink / raw)
  To: Stefan Beller
  Cc: Marc Branchaud, git@vger.kernel.org, Junio C Hamano,
	Michael Haggerty, Ævar Arnfjörð Bjarmason

On Mon, May 08, 2017 at 10:13:41AM -0700, Stefan Beller wrote:

> > -test_expect_success 'diff: nice spaces with diff.indentHeuristic' '
> > +test_expect_success 'diff: nice spaces with diff.indentHeuristic=true' '
> 
> Adding the '=true' seems weird to me (I'd think the true is implied,
> similar to C,
> where we do "if (!null_pointer)" instead of an explicit "!=null".
> However we do have these '=true' sprinkled all over the tests,
> so I guess it is a valid dialect in our test suite.

I think it's better to be explicit here. I think the original was less
about "implied true", as it was making the assumption that the feature
was off in the first place. Now that we've flipped that, just saying
"diff.indentHeuristic" is unclear whether you mean the "implied true"
of:

  git -c diff.indentHeuristic diff ...

or if you mean setting diff.indentHeuristic at all but aren't saying
which (which I think is how the original meant it).

I dunno. I guess it is subjective, but IMHO the "=true" is much clearer.

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling
  2017-05-08 16:03     ` [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling Marc Branchaud
@ 2017-05-09  3:29       ` Jeff King
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff King @ 2017-05-09  3:29 UTC (permalink / raw)
  To: Marc Branchaud
  Cc: git, Junio C Hamano, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

On Mon, May 08, 2017 at 12:03:39PM -0400, Marc Branchaud wrote:

> @@ -730,9 +729,6 @@ sub parse_diff {
>  	if (defined $diff_algorithm) {
>  		splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
>  	}
> -	if ($diff_indent_heuristic) {
> -		splice @diff_cmd, 1, 0, "--indent-heuristic";
> -	}

I don't remember if I mentioned this before, but this series (and the
reasoning why it is OK to tweak the default) did make me wonder if it
be reasonable to respect diff.algorithm even in plumbing.

I don't actually use it myself, and certainly it would not need to be
part of this series. But perhaps if somebody is really into alternate
diff algorithms they'd be interested in following it up (my own
experience with alternate algorithms has usually been "wow, this diff is
ugly; I wonder if --patience helps" followed by "nope, still ugly").

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic.
  2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
                       ` (4 preceding siblings ...)
  2017-05-08 17:13     ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Stefan Beller
@ 2017-05-09  3:32     ` Jeff King
  5 siblings, 0 replies; 14+ messages in thread
From: Jeff King @ 2017-05-09  3:32 UTC (permalink / raw)
  To: Marc Branchaud
  Cc: git, Junio C Hamano, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

On Mon, May 08, 2017 at 12:03:35PM -0400, Marc Branchaud wrote:

> The only change from v3 is in 3/4, to expand t4061 to test various
> combinations of --(no-)indent-heuristic and diff.indentHeuristic.
> 
> I kindof went all-in and tried to cover every possible combination for
> all four affected commands.

TBH, I don't know that we need to be that thorough. Unless we have a
reason to believe that the code will behave differently in context A
versus B, it's probably not buying us much. It would be nice, of course,
if we could get full coverage of all possible paths through the program,
but I think that involves a combinator explosion.

But I'm OK with what you have here (the whole series, though I dropped
one or two comments while reading it).

-Peff

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions
  2017-05-09  3:22       ` Jeff King
@ 2017-05-11 19:22         ` Marc Branchaud
  0 siblings, 0 replies; 14+ messages in thread
From: Marc Branchaud @ 2017-05-11 19:22 UTC (permalink / raw)
  To: Jeff King
  Cc: git, Junio C Hamano, Stefan Beller, Michael Haggerty,
	Ævar Arnfjörð Bjarmason

On 2017-05-08 11:22 PM, Jeff King wrote:
> On Mon, May 08, 2017 at 12:03:37PM -0400, Marc Branchaud wrote:
>
>> 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.
>
> I don't know if you want to note here that this is only _some_ options.
> I.e., ones that we handle by copying via diff_setup(). Maybe it's
> obvious from the description already (it's hard for me to tell because I
> already know it either way :) ).

(shrug)  I'm fine with the way it is, but I'd also be OK with "respect 
some of diff's configuration options".

Junio, please feel free to reword the message if you like.  Or I can 
send out a v5, if that's easier for you.

		M.


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-05-11 19:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08  7:48 What's cooking in git.git (May 2017, #02; Mon, 8) Junio C Hamano
2017-05-08 14:54 ` Enabling the diff "indent" heuristic by default Marc Branchaud
2017-05-08 16:03   ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Marc Branchaud
2017-05-08 16:03     ` [PATCH v4 1/4] diff: make the indent heuristic part of diff's basic configuration Marc Branchaud
2017-05-08 16:03     ` [PATCH v4 2/4] diff: have the diff-* builtins configure diff before initializing revisions Marc Branchaud
2017-05-09  3:22       ` Jeff King
2017-05-11 19:22         ` Marc Branchaud
2017-05-08 16:03     ` [PATCH v4 3/4] diff: enable indent heuristic by default Marc Branchaud
2017-05-08 16:03     ` [PATCH v4 4/4] add--interactive: drop diff.indentHeuristic handling Marc Branchaud
2017-05-09  3:29       ` Jeff King
2017-05-08 17:13     ` [PATCH v4 0/4] Make diff plumbing commands respect the indentHeuristic Stefan Beller
2017-05-09  3:27       ` Jeff King
2017-05-09  3:32     ` Jeff King
2017-05-09  3:20   ` Enabling the diff "indent" heuristic by default Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).