{"thread":{"id":"48510","subject":"What's cooking in git.git (May 2018, #02; Thu, 17)","startedAt":"2018-05-17T06:01:52Z","lastAt":"2018-09-10T19:38:53Z","messageCount":95,"participants":["Junio C Hamano","Kaartic Sivaraam","Ævar Arnfjörð Bjarmason","Derrick Stolee","Jeff King","Stefan Beller","Jonathan Tan","Simon Ruderich","Leif Middelschulte","Elijah Newren","brian m. carlson","Martin Ågren","Duy Nguyen","Kaartic.Sivaraam","Jacob Keller","Ben Peart"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"347897","messageId":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":null,"subject":"What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-17T06:01:40Z","receivedAt":"2018-05-17T06:01:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with\n'-' are only in 'pu' (proposed updates) while commits prefixed with\n'+' are in 'next'.  The ones marked with '.' do not appear in any of\nthe integration branches, but I am still holding onto them.\n\nYou can find the changes described here in the integration branches\nof the repositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* hn/sort-ls-remote (2018-04-09) 1 commit\n  (merged to 'next' on 2018-04-30 at 244ca5d30a)\n + ls-remote: create '--sort' option\n\n \"git ls-remote\" learned an option to allow sorting its output based\n on the refnames being shown.\n\n\n* sb/object-store-replace (2018-04-12) 15 commits\n  (merged to 'next' on 2018-04-25 at 9a213fb505)\n + replace-object: allow lookup_replace_object to handle arbitrary repositories\n + replace-object: allow do_lookup_replace_object to handle arbitrary repositories\n + replace-object: allow prepare_replace_object to handle arbitrary repositories\n + refs: allow for_each_replace_ref to handle arbitrary repositories\n + refs: store the main ref store inside the repository struct\n + replace-object: add repository argument to lookup_replace_object\n + replace-object: add repository argument to do_lookup_replace_object\n + replace-object: add repository argument to prepare_replace_object\n + refs: add repository argument to for_each_replace_ref\n + refs: add repository argument to get_main_ref_store\n + replace-object: check_replace_refs is safe in multi repo environment\n + replace-object: eliminate replace objects prepared flag\n + object-store: move lookup_replace_object to replace-object.h\n + replace-object: move replace_map to object store\n + replace_object: use oidmap\n (this branch is used by sb/object-store-alloc and sb/oid-object-info.)\n\n The effort to pass the repository in-core structure throughout the\n API continues.  This round deals with the code that implements the\n refs/replace/ mechanism.\n\n\n* ab/git-svn-get-record-typofix (2018-04-09) 1 commit\n  (merged to 'next' on 2018-04-30 at 23f875f6b9)\n + git-svn: avoid warning on undef readline()\n\n \"git svn\" had a minor thinko/typo which has been fixed.\n\n\n* ab/nuke-emacs-contrib (2018-04-16) 1 commit\n  (merged to 'next' on 2018-04-25 at 9b133d8a65)\n + git{,-blame}.el: remove old bitrotting Emacs code\n\n The scripts in contrib/emacs/ have outlived their usefulness and\n have been replaced with a stub that errors out and tells the user\n there are replacements.\n\n\n* ab/simplify-perl-makefile (2018-04-19) 2 commits\n  (merged to 'next' on 2018-04-25 at 906cf21682)\n + Makefile: mark perllibdir as a .PHONY target\n  (merged to 'next' on 2018-04-17 at 4448756934)\n + perl: fix installing modules from contrib\n\n Recent simplification of build procedure forgot a bit of tweak to\n the build procedure of contrib/mw-to-git/\n\n\n* bt/gpg-interface (2018-04-16) 7 commits\n  (merged to 'next' on 2018-04-30 at 50c507b7d8)\n + gpg-interface: find the last gpg signature line\n + gpg-interface: extract gpg line matching helper\n + gpg-interface: fix const-correctness of \"eol\" pointer\n + gpg-interface: use size_t for signature buffer size\n + gpg-interface: modernize function declarations\n + gpg-interface: handle bool user.signingkey\n + t7004: fix mistaken tag name\n\n What is queued here is only the obviously correct and\n uncontroversial code clean-up part, which is an earlier 7 patches,\n of a larger series.\n\n The remainder that is not queued introduces a few configuration\n variables to deal with e-signature backends with different\n signature format.\n\n\n* bw/protocol-v2 (2018-03-15) 35 commits\n  (merged to 'next' on 2018-04-11 at 23ee234a2c)\n + remote-curl: don't request v2 when pushing\n + remote-curl: implement stateless-connect command\n + http: eliminate \"# service\" line when using protocol v2\n + http: don't always add Git-Protocol header\n + http: allow providing extra headers for http requests\n + remote-curl: store the protocol version the server responded with\n + remote-curl: create copy of the service name\n + pkt-line: add packet_buf_write_len function\n + transport-helper: introduce stateless-connect\n + transport-helper: refactor process_connect_service\n + transport-helper: remove name parameter\n + connect: don't request v2 when pushing\n + connect: refactor git_connect to only get the protocol version once\n + fetch-pack: support shallow requests\n + fetch-pack: perform a fetch using v2\n + upload-pack: introduce fetch server command\n + push: pass ref prefixes when pushing\n + fetch: pass ref prefixes when fetching\n + ls-remote: pass ref prefixes when requesting a remote's refs\n + transport: convert transport_get_remote_refs to take a list of ref prefixes\n + transport: convert get_refs_list to take a list of ref prefixes\n + connect: request remote refs using v2\n + ls-refs: introduce ls-refs server command\n + serve: introduce git-serve\n + test-pkt-line: introduce a packet-line test helper\n + protocol: introduce enum protocol_version value protocol_v2\n + transport: store protocol version\n + connect: discover protocol version outside of get_remote_heads\n + connect: convert get_remote_heads to use struct packet_reader\n + transport: use get_refs_via_connect to get refs\n + upload-pack: factor out processing lines\n + upload-pack: convert to a builtin\n + pkt-line: add delim packet support\n + pkt-line: allow peeking a packet line without consuming it\n + pkt-line: introduce packet_read_with_status\n (this branch is used by bw/server-options and jt/partial-clone-proto-v2.)\n\n The beginning of the next-gen transfer protocol.\n\n\n* dj/runtime-prefix (2018-04-24) 7 commits\n  (merged to 'next' on 2018-04-25 at e7e635a70e)\n + Makefile: quote $INSTLIBDIR when passing it to sed\n + Makefile: remove unused @@PERLLIBDIR@@ substitution variable\n  (merged to 'next' on 2018-04-17 at a69aaa7a22)\n + mingw/msvc: use the new-style RUNTIME_PREFIX helper\n + exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows\n + exec_cmd: RUNTIME_PREFIX on some POSIX systems\n + Makefile: add Perl runtime prefix support\n + Makefile: generate Perl header from template file\n (this branch is tangled with js/runtime-prefix.)\n\n A build-time option has been added to allow Git to be told to refer\n to its associated files relative to the main binary, in the same\n way that has been possible on Windows for quite some time, for\n Linux, BSDs and Darwin.\n\n\n* ds/commit-graph (2018-04-11) 16 commits\n  (merged to 'next' on 2018-04-25 at 18af3d28d9)\n + commit-graph: implement \"--append\" option\n + commit-graph: build graph from starting commits\n + commit-graph: read only from specific pack-indexes\n + commit: integrate commit graph with commit parsing\n + commit-graph: close under reachability\n + commit-graph: add core.commitGraph setting\n + commit-graph: implement git commit-graph read\n + commit-graph: implement git-commit-graph write\n + commit-graph: implement write_commit_graph()\n + commit-graph: create git-commit-graph builtin\n + graph: add commit graph design document\n + commit-graph: add format document\n + csum-file: refactor finalize_hashfile() method\n + csum-file: rename hashclose() to finalize_hashfile()\n + Merge branch 'jk/cached-commit-buffer' into HEAD\n + Merge branch 'jt/binsearch-with-fanout' into HEAD\n (this branch is used by ds/generation-numbers and ds/lazy-load-trees.)\n\n Precompute and store information necessary for ancestry traversal\n in a separate file to optimize graph walking.\n\n Will merge to 'master'.\n\n\n* jc/parseopt-expiry-errors (2018-04-23) 2 commits\n  (merged to 'next' on 2018-04-30 at 637085f3d8)\n + parseopt: handle malformed --expire arguments more nicely\n + gc: do not upcase error message shown with die()\n\n \"git gc --prune=nonsense\" spent long time repacking and then\n silently failed when underlying \"git prune --expire=nonsense\"\n failed to parse its command line.  This has been corrected.\n\n\n* js/colored-push-errors (2018-04-24) 4 commits\n  (merged to 'next' on 2018-04-30 at 31076c52a2)\n + config: document the settings to colorize push errors/hints\n + push: test to verify that push errors are colored\n + push: colorize errors\n + color: introduce support for colorizing stderr\n\n Error messages from \"git push\" can be painted for more visibility.\n\n\n* js/empty-config-section-fix (2018-04-09) 15 commits\n  (merged to 'next' on 2018-04-25 at 1690df3e5f)\n + git_config_set: reuse empty sections\n + git config --unset: remove empty sections (in the common case)\n + git_config_set: make use of the config parser's event stream\n + git_config_set: do not use a state machine\n + config_set_store: rename some fields for consistency\n + config: avoid using the global variable `store`\n + config: introduce an optional event stream while parsing\n + t1300: `--unset-all` can leave an empty section behind (bug)\n + t1300: add a few more hairy examples of sections becoming empty\n + t1300: remove unreasonable expectation from TODO\n + t1300: avoid relying on a bug\n + config --replace-all: avoid extra line breaks\n + t1300: demonstrate that --replace-all can \"invent\" newlines\n + t1300: rename it to reflect that `repo-config` was deprecated\n + git_config_set: fix off-by-two\n\n \"git config --unset a.b\", when \"a.b\" is the last variable in an\n otherwise empty section \"a\", left an empty section \"a\" behind, and\n worse yet, a subsequent \"git config a.c value\" did not reuse that\n empty shell and instead created a new one.  These have been\n (partially) corrected.\n\n\n* js/ident-date-fix (2018-04-19) 1 commit\n  (merged to 'next' on 2018-04-30 at d50ec2f4c1)\n + sequencer: reset the committer date before commits\n\n During a \"rebase -i\" session, the code could give older timestamp\n to commits created by later \"pick\" than an earlier \"reword\", which\n has been corrected.\n\n\n* js/runtime-prefix (2018-04-24) 8 commits\n  (merged to 'next' on 2018-04-30 at c6cfccf40e)\n + Avoid multiple PREFIX definitions\n + git_setup_gettext: plug memory leak\n + gettext: avoid initialization if the locale dir is not present\n  (merged to 'next' on 2018-04-17 at a69aaa7a22)\n + mingw/msvc: use the new-style RUNTIME_PREFIX helper\n + exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows\n + exec_cmd: RUNTIME_PREFIX on some POSIX systems\n + Makefile: add Perl runtime prefix support\n + Makefile: generate Perl header from template file\n (this branch is tangled with dj/runtime-prefix.)\n\n\n* ls/checkout-encoding (2018-04-16) 10 commits\n  (merged to 'next' on 2018-04-25 at e0f8554b2a)\n + convert: add round trip check based on 'core.checkRoundtripEncoding'\n + convert: add tracing for 'working-tree-encoding' attribute\n + convert: check for detectable errors in UTF encodings\n + convert: add 'working-tree-encoding' attribute\n + utf8: add function to detect a missing UTF-16/32 BOM\n + utf8: add function to detect prohibited UTF-16/32 BOM\n + utf8: teach same_encoding() alternative UTF encoding names\n + strbuf: add a case insensitive starts_with()\n + strbuf: add xstrdup_toupper()\n + strbuf: remove unnecessary NUL assignment in xstrdup_tolower()\n\n The new \"checkout-encoding\" attribute can ask Git to convert the\n contents to the specified encoding when checking out to the working\n tree (and the other way around when checking in).\n\n\n* ma/double-dashes-in-docs (2018-04-18) 4 commits\n  (merged to 'next' on 2018-04-25 at aaac2dc63c)\n + git-submodule.txt: quote usage in monospace, drop backslash\n + git-[short]log.txt: unify quoted standalone --\n + doc: convert [\\--] to [--]\n + doc: convert \\--option to --option\n\n Doc formatting updates.\n\n\n* ma/fast-export-skip-merge-fix (2018-04-21) 1 commit\n  (merged to 'next' on 2018-04-30 at f7fca02ab1)\n + fast-export: fix regression skipping some merge-commits\n\n \"git fast-export\" had a regression in v2.15.0 era where it skipped\n some merge commits in certain cases, which has been corrected.\n\n\n* ma/http-walker-no-partial (2018-04-24) 2 commits\n  (merged to 'next' on 2018-04-30 at 4582c99ba8)\n + walker: drop fields of `struct walker` which are always 1\n + http-fetch: make `-a` standard behavior\n\n \"git http-fetch\" (deprecated) had an optional and experimental\n \"feature\" to fetch only commits and/or trees, which nobody used.\n This has been removed.\n\n\n* nd/submodule-status-fix (2018-04-19) 1 commit\n  (merged to 'next' on 2018-04-30 at 34d1f9ca83)\n + submodule--helper: don't print null in 'submodule status'\n\n \"git submodule status\" did not check the symbolic revision name it\n computed for the submodule HEAD is not the NULL, and threw it at\n printf routines, which has been corrected.\n\n\n* nd/warn-more-for-devs (2018-04-16) 4 commits\n  (merged to 'next' on 2018-04-25 at 2978e61414)\n + Makefile: add a DEVOPTS to get all of -Wextra\n + Makefile: add a DEVOPTS to suppress -Werror under DEVELOPER\n + Makefile: detect compiler and enable more warnings in DEVELOPER=1\n + connect.c: mark die_initial_contact() NORETURN\n\n The build procedure \"make DEVELOPER=YesPlease\" learned to enable a\n bit more warning options depending on the compiler used to help\n developers more.  There also is \"make DEVOPTS=tokens\" knob\n available now, for those who want to help fixing warnings we\n usually ignore, for example.\n\n\n* ot/libify-get-ref-atom-value (2018-03-29) 6 commits\n  (merged to 'next' on 2018-04-25 at 056bcaa69c)\n + ref-filter: libify get_ref_atom_value()\n + ref-filter: add return value to parsers\n + ref-filter: change parsing function error handling\n + ref-filter: add return value && strbuf to handlers\n + ref-filter: start adding strbufs with errors\n + ref-filter: add shortcut to work with strbufs\n\n Code restructuring, in preparation for further work.\n\n\n* sa/send-email-dedup-some-headers (2018-04-19) 1 commit\n  (merged to 'next' on 2018-04-30 at 2a1fd8217e)\n + send-email: avoid duplicate In-Reply-To/References\n\n When fed input that already has In-Reply-To: and/or References:\n headers and told to add the same information, \"git send-email\"\n added these headers separately, instead of appending to an existing\n one, which is a violation of the RFC.  This has been corrected.\n\n\n* sb/submodule-move-nested (2018-03-29) 6 commits\n  (merged to 'next' on 2018-04-25 at 86b177433a)\n + submodule: fixup nested submodules after moving the submodule\n + submodule-config: remove submodule_from_cache\n + submodule-config: add repository argument to submodule_from_{name, path}\n + submodule-config: allow submodule_free to handle arbitrary repositories\n + grep: remove \"repo\" arg from non-supporting funcs\n + submodule.h: drop declaration of connect_work_tree_and_git_dir\n\n Moving a submodule that itself has submodule in it with \"git mv\"\n forgot to make necessary adjustment to the nested sub-submodules;\n now the codepath learned to recurse into the submodules.\n\n\n* sb/worktree-remove-opt-force (2018-04-18) 1 commit\n  (merged to 'next' on 2018-04-25 at 0367d52a4b)\n + worktree: accept -f as short for --force for removal\n\n \"git worktree remove\" learned that \"-f\" is a shorthand for\n \"--force\" option, just like for \"git worktree add\".\n\n\n* sg/completion-clear-cached (2018-04-18) 1 commit\n  (merged to 'next' on 2018-04-25 at 9178da6c3d)\n + completion: reduce overhead of clearing cached --options\n\n The completion script (in contrib/) learned to clear cached list of\n command line options upon dot-sourcing it again in a more efficient\n way.\n\n\n* sg/doc-gc-quote-mismatch-fix (2018-04-18) 1 commit\n  (merged to 'next' on 2018-04-25 at bc3d1abf45)\n + docs/git-gc: fix minor rendering issue\n\n Doc formatting fix.\n\n\n* so/glossary-ancestor (2018-04-17) 1 commit\n  (merged to 'next' on 2018-04-25 at 0a849fee00)\n + glossary: substitute \"ancestor\" for \"direct ancestor\" in 'push' description.\n\n Docfix.\n\n\n* tb/config-default (2018-04-23) 3 commits\n  (merged to 'next' on 2018-04-25 at 59bb6beb2a)\n + builtin/config: introduce `color` type specifier\n + config.c: introduce 'git_config_color' to parse ANSI colors\n + builtin/config: introduce `--default`\n (this branch uses tb/config-type.)\n\n \"git config --get\" learned the \"--default\" option, to help the\n calling script.  Building on top of the tb/config-type topic, the\n \"git config\" learns \"--type=color\" type.  Taken together, you can\n do things like \"git config --get foo.color --default blue\" and get\n the ANSI color sequence for the color given to foo.color variable,\n or \"blue\" if the variable does not exist.\n\n\n* tb/config-type (2018-04-19) 2 commits\n  (merged to 'next' on 2018-04-25 at fe69e93c82)\n + builtin/config.c: support `--type=<type>` as preferred alias for `--<type>`\n + builtin/config.c: treat type specifiers singularly\n (this branch is used by tb/config-default.)\n\n The \"git config\" command uses separate options e.g. \"--int\",\n \"--bool\", etc. to specify what type the caller wants the value to\n be interpreted as.  A new \"--type=<typename>\" option has been\n introduced, which would make it cleaner to define new types.\n\n\n* tg/demote-stash-save-in-completion (2018-04-20) 2 commits\n  (merged to 'next' on 2018-04-30 at 93d0af5375)\n + completion: make stash -p and alias for stash push -p\n + completion: stop showing 'save' for stash by default\n\n The command line completion (in contrib/) has been taught that \"git\n stash save\" has been deprecated (\"git stash push\" is the preferred\n spelling in the new world) and does not offer it as a possible\n completion candidate when \"git stash push\" can be.\n\n\n* tq/t1510 (2018-04-17) 1 commit\n  (merged to 'next' on 2018-04-25 at 5710c81979)\n + t1510-repo-setup.sh: remove useless mkdir\n\n Test cleanup.\n\n\n* tz/doc-git-urls-reference (2018-04-20) 1 commit\n  (merged to 'next' on 2018-04-30 at 39926c99fd)\n + doc/clone: update caption for GIT URLS cross-reference\n\n Doc fix.\n\n--------------------------------------------------\n[New Topics]\n\n* hn/sort-ls-remote (2018-05-14) 1 commit\n  (merged to 'next' on 2018-05-16 at 64336850f2)\n + t5512: run git fetch inside test\n\n Hotfix.\n\n Will merge to 'master'.\n\n\n* sb/object-store-replace (2018-05-10) 2 commits\n  (merged to 'next' on 2018-05-16 at 41bbedcc81)\n + replace-object.c: remove the_repository from prepare_replace_object\n + object.c: free replace map in raw_object_store_clear\n\n Hotfix.\n\n Will merge to 'master'.\n\n\n* sg/t6500-no-redirect-of-stdin (2018-05-09) 1 commit\n - t6050-replace: don't disable stdin for the whole test script\n\n Test cleanup.\n\n Will merge to 'next'.\n\n\n* ao/config-api-doc (2018-05-11) 1 commit\n - doc: fix config API documentation about config_with_options\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* bc/hash-independent-tests (2018-05-16) 28 commits\n - t5300: abstract away SHA-1-specific constants\n - t4208: abstract away SHA-1-specific constants\n - t4045: abstract away SHA-1-specific constants\n - t4042: abstract away SHA-1-specific constants\n - t4205: sort log output in a hash-independent way\n - t/lib-diff-alternative: abstract away SHA-1-specific constants\n - t4030: abstract away SHA-1-specific constants\n - t4029: abstract away SHA-1-specific constants\n - t4029: fix test indentation\n - t4022: abstract away SHA-1-specific constants\n - t4020: abstract away SHA-1-specific constants\n - t4014: abstract away SHA-1-specific constants\n - t4008: abstract away SHA-1-specific constants\n - t4007: abstract away SHA-1-specific constants\n - t3905: abstract away SHA-1-specific constants\n - t3702: abstract away SHA-1-specific constants\n - t3103: abstract away SHA-1-specific constants\n - t2203: abstract away SHA-1-specific constants\n - t: skip pack tests if not using SHA-1\n - t4044: skip test if not using SHA-1\n - t1512: skip test if not using SHA-1\n - t1007: annotate with SHA1 prerequisite\n - t0000: annotate with SHA1 prerequisite\n - t: switch $_x40 to $OID_REGEX\n - t/test-lib: introduce OID_REGEX\n - t: switch $_z40 to $ZERO_OID\n - t/test-lib: introduce ZERO_OID\n - t/test-lib: add an SHA1 prerequisite\n\n Many tests hardcode the raw object names, which would change once\n we migrate away from SHA-1.  While some of them must test against\n exact object names, most of them do not have to use hardcoded\n constants in the test.  The latter kind of tests have been updated\n to test the moral equivalent of the original without hardcoding the\n actual object names.\n\n Will merge to 'next'.\n\n\n* bp/status-rename-config (2018-05-13) 1 commit\n - add status config and command line options for rename detection\n (this branch uses em/status-rename-config.)\n\n \"git status\" learned to honor a new status.renames configuration to\n skip rename detection, which could be useful for those who want to\n do so without disabling the default rename detection done by the\n \"git diff\" command.\n\n Will merge to 'next'.\n\n\n* bw/refspec-api (2018-05-16) 35 commits\n - submodule: convert push_unpushed_submodules to take a struct refspec\n - remote: convert check_push_refs to take a struct refspec\n - remote: convert match_push_refs to take a struct refspec\n - http-push: store refspecs in a struct refspec\n - transport: remove transport_verify_remote_names\n - send-pack: store refspecs in a struct refspec\n - transport: convert transport_push to take a struct refspec\n - push: convert to use struct refspec\n - push: check for errors earlier\n - remote: convert match_explicit_refs to take a struct refspec\n - remote: convert get_ref_match to take a struct refspec\n - remote: convert query_refspecs to take a struct refspec\n - remote: convert apply_refspecs to take a struct refspec\n - remote: convert get_stale_heads to take a struct refspec\n - fetch: convert prune_refs to take a struct refspec\n - fetch: convert get_ref_map to take a struct refspec\n - fetch: convert do_fetch to take a struct refspec\n - refspec: remove the deprecated functions\n - fetch: convert refmap to use struct refspec\n - fetch: convert fetch_one to use struct refspec\n - transport-helper: convert to use struct refspec\n - remote: convert fetch refspecs to struct refspec\n - remote: convert push refspecs to struct refspec\n - fast-export: convert to use struct refspec\n - clone: convert cmd_clone to use refspec_item_init\n - remote: convert match_push_refs to use struct refspec\n - remote: convert check_push_refs to use struct refspec\n - transport: convert transport_push to use struct refspec\n - pull: convert get_tracking_branch to use refspec_item_init\n - submodule--helper: convert push_check to use struct refspec\n - refspec: convert valid_fetch_refspec to use parse_refspec\n - refspec: introduce struct refspec\n - refspec: rename struct refspec to struct refspec_item\n - refspec: factor out parsing a single refspec\n - refspec: move refspec parsing logic into its own file\n\n An API update for handling of refspecs used by fetch & push\n codepath.\n\n Will merge to 'next'.\n\n\n* ds/commit-graph-lockfile-fix (2018-05-11) 1 commit\n - commit-graph: fix UX issue when .lock file exists\n (this branch uses ds/generation-numbers and ds/lazy-load-trees.)\n\n Update to ds/generation-numbers topic.\n\n\n* jk/apply-p-doc (2018-05-11) 1 commit\n - apply: clarify \"-p\" documentation\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* jk/unavailable-can-be-missing (2018-05-13) 4 commits\n - mark_parents_uninteresting(): avoid most allocation\n - mark_parents_uninteresting(): replace list with stack\n - mark_parents_uninteresting(): drop missing object check\n - mark_tree_contents_uninteresting(): drop missing object check\n\n Code clean-up to turn history traversal more robust in a\n semi-corrupt repository.\n\n Will merge to 'next'.\n\n\n* lm/credential-netrc (2018-05-14) 2 commits\n - git-credential-netrc: accept gpg option\n - git-credential-netrc: adapt to test framework for git\n\n Update credential-netrc helper (in contrib/) to allow customizing\n the GPG used to decrypt the encrypted .netrc file.\n\n Will merge to 'next'.\n\n\n* ma/create-pseudoref-with-null-old-oid (2018-05-13) 3 commits\n - refs: handle zero oid for pseudorefs\n - t1400: add tests around adding/deleting pseudorefs\n - refs.c: refer to \"object ID\", not \"sha1\", in error messages\n\n \"git update-ref A B\" is supposed to ensure that ref A does not yet\n exist when B is a NULL OID, but this check was not done correctly\n for pseudo-refs outside refs/ hierarchy, e.g. MERGE_HEAD.\n\n Will merge to 'next'.\n\n\n* ma/lockfile-cleanup (2018-05-10) 5 commits\n - lock_file: move static locks into functions\n - lock_file: make function-local locks non-static\n - refs.c: do not die if locking fails in `delete_pseudoref()`\n - refs.c: do not die if locking fails in `write_pseudoref()`\n - t/helper/test-write-cache: clean up lock-handling\n\n Code clean-up to adjust to a more recent lockfile API convention that\n allows lockfile instances kept on the stack.\n\n Will merge to 'next'.\n\n\n* nd/commit-util-to-slab (2018-05-14) 14 commits\n - commit.h: delete 'util' field in struct commit\n - merge: use commit-slab in merge remote desc instead of commit->util\n - log: use commit-slab in prepare_bases() instead of commit->util\n - show-branch: use commit-slab for commit-name instead of commit->util\n - name-rev: use commit-slab for rev-name instead of commit->util\n - bisect.c: use commit-slab for commit weight instead of commit->util\n - revision.c: use commit-slab for show_source\n - sequencer.c: use commit-slab to associate todo items to commits\n - sequencer.c: use commit-slab to mark seen commits\n - shallow.c: use commit-slab for commit depth instead of commit->util\n - describe: use commit-slab for commit names instead of commit->util\n - blame: use commit-slab for blame suspects instead of commit->util\n - commit-slab: support shared commit-slab\n - commit-slab.h: code split\n\n The in-core \"commit\" object had an all-purpose \"void *util\" field,\n which was tricky to use especially in library-ish part of the\n code.  All of the existing uses of the field has been migrated to a\n more dedicated \"commit-slab\" mechanism and the field is eliminated.\n\n Will merge to 'next'.\n\n\n* nd/diff-apply-ita (2018-05-14) 2 commits\n - apply: add --intent-to-add\n - diff: turn --ita-invisible-in-index on by default\n\n \"git diff\" compares the index and the working tree.  For paths\n added with intent-to-add bit, the command shows the full contents\n of them as added, but the paths themselves were not marked as new\n files.  They are now shown as new by default.\n\n \"git apply\" learned the \"--intent-to-add\" option so that an\n otherwise working-tree-only application of a patch will add new\n paths to the index marked with the \"intent-to-add\" bit.\n\n Will merge to and cook in 'next'.\n\n\n* nd/pack-format-doc (2018-05-13) 1 commit\n - pack-format.txt: more details on pack file format\n\n Doc update.\n\n Will merge to 'next'.\n\n\n* nd/pack-struct-commit (2018-05-13) 1 commit\n - commit.h: rearrange 'index' to shrink struct commit\n\n Memory optimization.\n\n Will merge to 'next'.\n\n\n* nd/repo-clear-keep-the-index (2018-05-10) 1 commit\n - repository: fix free problem with repo_clear(the_repository)\n\n the_repository->index is not a allocated piece of memory but\n repo_clear() indiscriminately attempted to free(3) it, which has\n been corrected.\n\n Will merge to 'next'.\n\n\n* nd/term-columns (2018-05-13) 2 commits\n - column: fix off-by-one default width\n - pager: set COLUMNS to term_columns()\n\n The code did not propagate the terminal width to subprocesses via\n COLUMNS environment variable, which it now does.  This caused\n trouble to \"git column\" helper subprocess when \"git tag --column=row\"\n tried to list the existing tags on a display with non-default width.\n\n Will merge to 'next'.\n\n\n* nd/travis-gcc-7 (2018-05-14) 1 commit\n - travis-ci: run gcc-7 on linux-gcc jobs\n\n Developer support.  Use newer GCC on one of the builds done at\n TravisCI.org to get more warnings and errors diagnosed.\n\n Will merge to 'next'.\n\n\n* rs/no-null-ptr-arith-in-fast-export (2018-05-10) 1 commit\n - fast-export: avoid NULL pointer arithmetic\n\n Code clean-up to avoid non-standard-conformant pointer arithmetic.\n\n Will merge to 'next'.\n\n\n* sb/grep-die-on-unreadable-index (2018-05-16) 1 commit\n - grep: handle corrupt index files early\n\n\n* sb/object-store-grafts (2018-05-16) 19 commits\n - commit: allow lookup_commit_graft to handle arbitrary repositories\n - commit: allow prepare_commit_graft to handle arbitrary repositories\n - shallow: migrate shallow information into the object parser\n - path.c: migrate git_path_ to take a repository argument\n - cache: convert get_graft_file to handle arbitrary repositories\n - commit: convert read_graft_file to handle arbitrary repositories\n - commit: convert register_commit_graft to handle arbitrary repositories\n - commit: convert commit_graft_pos() to handle arbitrary repositories\n - shallow: add repository argument to is_repository_shallow\n - shallow: add repository argument to check_shallow_file_for_update\n - shallow: add repository argument to register_shallow\n - shallow: add repository argument to set_alternate_shallow_file\n - commit: add repository argument to lookup_commit_graft\n - commit: add repository argument to prepare_commit_graft\n - commit: add repository argument to read_graft_file\n - commit: add repository argument to register_commit_graft\n - commit: add repository argument to commit_graft_pos\n - object: move grafts to object parser\n - object-store: move object access functions to object-store.h\n (this branch uses sb/object-store-alloc and sb/oid-object-info.)\n\n\n* sb/submodule-merge-in-merge-recursive (2018-05-16) 3 commits\n - merge-recursive: give notice when submodule commit gets fast-forwarded\n - merge-recursive: i18n submodule merge output and respect verbosity\n - submodule.c: move submodule merging to merge-recursive.c\n\n By code restructuring of submodule merge in merge-recursive,\n informational messages from the codepath are now given using the\n same mechanism as other output, and honor the merge.verbosity\n configuration.  The code also learned to give a few new messages\n when a submodule three-way merge resolves cleanly when one side\n records a descendant of the commit chosen by the other side.\n\n Will merge to 'next'.\n\n\n* sb/submodule-update-try-harder (2018-05-16) 1 commit\n - git-submodule.sh: try harder to fetch a submodule\n\n \"git submodule update\" attempts two different kinds of \"git fetch\"\n against the upstream repository to grab a commit bound at the\n submodule's path, but it incorrectly gave up if the first kind\n (i.e. a normal fetch) failed, making the second \"last resort\" one\n (i.e. fetching an exact commit object by object name) ineffective.\n This has been corrected.\n\n Will merge to 'next'.\n\n\n* sg/t5310-jgit-bitmap-test (2018-05-11) 1 commit\n - t5310-pack-bitmaps: make JGit tests work with GIT_TEST_SPLIT_INDEX\n\n Test update.\n\n Will merge to 'next'.\n\n\n* sg/t5516-fixes (2018-05-11) 2 commits\n - t5516-fetch-push: fix broken &&-chain\n - t5516-fetch-push: fix 'push with dry-run' test\n\n Test fixes.\n\n Will merge to 'next'.\n\n\n* sg/t7005-spaces-in-filenames-cleanup (2018-05-15) 1 commit\n - t7005-editor: get rid of the SPACES_IN_FILENAMES prereq\n\n Test update.\n\n Will merge to 'next'.\n\n\n* tb/grep-only-matching (2018-05-14) 2 commits\n - builtin/grep.c: teach '-o', '--only-matching' to 'git-grep'\n - grep.c: extract show_line_header()\n (this branch uses tb/grep-column.)\n\n--------------------------------------------------\n[Stalled]\n\n* jm/cache-entry-from-mem-pool (2018-05-02) 5 commits\n - block alloc: add validations around cache_entry lifecyle\n - block alloc: allocate cache entries from mem_pool\n - mem-pool: fill out functionality\n - block alloc: add lifecycle APIs for cache_entry structs\n - read-cache: teach refresh_cache_entry() to take istate\n\n For a large tree, the index needs to hold many cache entries\n allocated on heap.  These cache entries are now allocated out of a\n dedicated memory pool to amortize malloc(3) overhead.\n\n Needs review.\n Is the \"caller always knows which pool an entry came from and calls\n the right kind of free\" a feasible approach?\n Oh, another thing, there is \"lifecyle\" typo in the title.\n\n\n* ab/fetch-tags-noclobber (2018-05-16) 9 commits\n - fixup! push tests: assert re-pushing annotated tags\n - fetch: stop clobbering existing tags without --force\n - fetch tests: add a test clobbering tag behavior\n - fetch tests: correct a comment \"remove it\" -> \"remove them\"\n - push doc: correct lies about how push refspecs work\n - push tests: assert re-pushing annotated tags\n - push tests: add more testing for forced tag pushing\n - push tests: fix logic error in \"push\" test assertion\n - push tests: remove redundant 'git push' invocation\n\n Expecting a reboot of the discussion to take it to some conclusion\n and then a reroll.\n cf. <f3b891c3-381f-de42-51d8-24fdfbca91d2@gmail.com>\n cf. <xmqq603yn50l.fsf@gitster-ct.c.googlers.com>\n cf. <xmqqzi1alodz.fsf@gitster-ct.c.googlers.com>\n cf. <xmqqvabylnbi.fsf@gitster-ct.c.googlers.com>\n\n\n* pw/add-p-select (2018-03-16) 3 commits\n - add -p: optimize line selection for short hunks\n - add -p: allow line selection to be inverted\n - add -p: select individual hunk lines\n\n \"git add -p\" interactive interface learned to let users choose\n individual added/removed lines to be used in the operation, instead\n of accepting or rejecting a whole hunk.\n\n Expecting a reroll to reignite the discussion.\n cf. <9895c7b7-eac4-28c1-90c6-443acd1131b7@talktalk.net>\n\n\n* jh/json-writer (2018-03-28) 1 commit\n - json_writer: new routines to create data in JSON format\n\n Preparatory code to later add json output for unspecified telemetry\n data.\n\n We do not add random code that does not have real users to our\n codebase, so let's have it wait until such a real code materializes\n before too long.\n\n\n* hn/bisect-first-parent (2018-04-21) 1 commit\n - bisect: create 'bisect_flags' parameter in find_bisection()\n\n Preliminary code update to allow passing more flags down the\n bisection codepath in the future.\n\n We do not add random code that does not have real users to our\n codebase, so let's have it wait until such a real code materializes\n before too long.\n\n\n* is/parsing-line-range (2018-04-27) 2 commits\n . log: prevent error if line range ends past end of file\n . blame: prevent error if range ends past end of file\n\n Parsing of -L[<N>][,[<M>]] parameters \"git blame\" and \"git log\"\n take has been tweaked.\n\n Seems to break a few tests.\n\n\n* av/fsmonitor-updates (2018-01-04) 6 commits\n - fsmonitor: use fsmonitor data in `git diff`\n - fsmonitor: remove debugging lines from t/t7519-status-fsmonitor.sh\n - fsmonitor: make output of test-dump-fsmonitor more concise\n - fsmonitor: update helper tool, now that flags are filled later\n - fsmonitor: stop inline'ing mark_fsmonitor_valid / _invalid\n - dir.c: update comments to match argument name\n\n Code clean-up on fsmonitor integration, plus optional utilization\n of the fsmonitor data in diff-files.\n\n Waiting for an update.\n cf. <alpine.DEB.2.21.1.1801042335130.32@MININT-6BKU6QN.europe.corp.microsoft.com>\n\n\n* pb/bisect-helper-2 (2017-10-28) 8 commits\n - t6030: make various test to pass GETTEXT_POISON tests\n - bisect--helper: `bisect_start` shell function partially in C\n - bisect--helper: `get_terms` & `bisect_terms` shell function in C\n - bisect--helper: `bisect_next_check` shell function in C\n - bisect--helper: `check_and_set_terms` shell function in C\n - wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()\n - bisect--helper: `bisect_write` shell function in C\n - bisect--helper: `bisect_reset` shell function in C\n\n Expecting a reroll.\n cf. <0102015f5e5ee171-f30f4868-886f-47a1-a4e4-b4936afc545d-000000@eu-west-1.amazonses.com>\n\n\n* mk/http-backend-content-length (2017-11-27) 4 commits\n - SQUASH???\n - t5560-http-backend-noserver.sh: add CONTENT_LENGTH cases\n - SQUASH???\n - http-backend: respect CONTENT_LENGTH as specified by rfc3875\n\n The http-backend (used for smart-http transport) used to slurp the\n whole input until EOF, without paying attention to CONTENT_LENGTH\n that is supplied in the environment and instead expecting the Web\n server to close the input stream.  This has been fixed.\n\n Expecting a reroll.\n Suggested fixes to be used when rerolling is queued, but I'd\n prefer _not_ squashing them myself.\n\n Also, it may be too complex solution for the problem.\n cf. <20171204171308.GA13332@sigill.intra.peff.net>\n\n\n* jk/drop-ancient-curl (2017-08-09) 5 commits\n - http: #error on too-old curl\n - curl: remove ifdef'd code never used with curl >=7.19.4\n - http: drop support for curl < 7.19.4\n - http: drop support for curl < 7.16.0\n - http: drop support for curl < 7.11.1\n\n Some code in http.c that has bitrot is being removed.\n\n Expecting a reroll.\n\n\n* mk/use-size-t-in-zlib (2017-08-10) 1 commit\n . zlib.c: use size_t for size\n\n The wrapper to call into zlib followed our long tradition to use\n \"unsigned long\" for sizes of regions in memory, which have been\n updated to use \"size_t\".\n\n Needs resurrecting by making sure the fix is good and still applies\n (or adjusted to today's codebase).\n\n--------------------------------------------------\n[Cooking]\n\n* ld/p4-unshelve (2018-05-16) 1 commit\n - git-p4: add unshelve command\n\n \"git p4\" learned to \"unshelve\" shelved commit from P4.\n\n Will merge to 'next'.\n\n\n* pc/submodule-helper-foreach (2018-05-11) 4 commits\n - submodule: port submodule subcommand 'foreach' from shell to C\n - submodule foreach: document variable '$displaypath'\n - submodule foreach: document '$sm_path' instead of '$path'\n - submodule foreach: correct '$path' in nested submodules from a subdirectory\n\n The bulk of \"git submodule foreach\" has been rewritten in C.\n\n Will merge to and cook in 'next'.\n\n\n* tb/test-apfs-utf8-normalization (2018-05-02) 1 commit\n  (merged to 'next' on 2018-05-16 at feabe72b42)\n + test: correct detection of UTF8_NFD_TO_NFC for APFS\n\n A test to see if the filesystem normalizes UTF-8 filename has been\n updated to check what we need to know in a more direct way, i.e. a\n path created in NFC form can be accessed with NFD form (or vice\n versa) to cope with APFS as well as HFS.\n\n Will merge to 'master'.\n\n\n* ab/get-short-oid (2018-05-11) 5 commits\n - get_short_oid: sort ambiguous objects by type, then SHA-1\n - sha1-name.c: move around the collect_ambiguous() function\n - git-p4: change \"commitish\" typo to \"committish\"\n - sha1-array.h: align function arguments\n - sha1-name.c: remove stray newline\n\n When a short hexadecimal string is used to name an object but there\n are multiple objects that share the string as the prefix of their\n names, the code lists these ambiguous candidates in a help message.\n These object names are now sorted according to their types for\n easier eyeballing.\n\n Will merge to 'next'.\n\n\n* ah/misc-doc-updates (2018-05-06) 7 commits\n  (merged to 'next' on 2018-05-16 at e2e3b68a66)\n + doc: normalize [--options] to [options] in git-diff\n + doc: add note about shell quoting to revision.txt\n + git-svn: remove ''--add-author-from' for 'commit-diff'\n + doc: add '-d' and '-o' for 'git push'\n + doc: clarify ignore rules for git ls-files\n + doc: align 'diff --no-index' in text and synopsis\n + doc: improve formatting in githooks.txt\n\n Misc doc fixes.\n\n Will merge to 'master'.\n\n\n* bc/format-patch-cover-no-attach (2018-05-02) 1 commit\n  (merged to 'next' on 2018-05-16 at fa1ffeb3fe)\n + format-patch: make cover letters always text/plain\n\n \"git format-patch --cover --attach\" created a broken MIME multipart\n message for the cover letter, which has been fixed by keeping the\n cover letter as plain text file.\n\n Will merge to 'master'.\n\n\n* bp/test-drop-caches (2018-05-04) 1 commit\n  (merged to 'next' on 2018-05-16 at 0e40ab2408)\n + test-drop-caches: simplify delay loading of NtSetSystemInformation\n\n Code simplification.\n\n Will merge to 'master'.\n\n\n* cc/perf-bisect (2018-05-06) 1 commit\n  (merged to 'next' on 2018-05-16 at 5a078a2fdf)\n + perf/bisect_run_script: disable codespeed\n\n Performance test updates.\n\n Will merge to 'master'.\n\n\n* cf/submodule-progress-dissociate (2018-05-04) 3 commits\n - submodule: add --dissociate option to add/update commands\n - submodule: add --progress option to add command\n - submodule: clean up subsititions in script\n\n \"git submodule update\" and \"git submodule add\" supported the\n \"--reference\" option to borrow objects from a neighbouring local\n repository like \"git clone\" does, but lacked the more recent\n invention \"--dissociate\".  Also \"git submodule add\" has been taught\n to take the \"--progress\" option.\n\n Will merge to 'next'..\n \"subsititions\" needs to be typofixed ;-)\n \n\n\n* dd/send-email-reedit (2018-05-06) 1 commit\n - git-send-email: allow re-editing of message\n\n \"git send-email\" can sometimes offer confirmation dialog \"Send this\n email?\" with choices 'Yes', 'No', 'Quit', and 'All'.  A new action\n 'Edit' has been added to this dialog's choice.\n\n Will merge to 'next'.\n\n\n* em/status-rename-config (2018-05-06) 1 commit\n  (merged to 'next' on 2018-05-16 at 33c1cc093c)\n + wt-status: use settings from git_diff_ui_config\n (this branch is used by bp/status-rename-config.)\n\n \"git status\" learned to pay attention to UI related diff\n configuration variables such as diff.renames.\n\n Will merge to 'master'.\n\n\n* js/branch-diff (2018-05-16) 19 commits\n - fixup! Add a function to solve least-cost assignment problems\n - completion: support branch-diff\n - branch-diff: add a man page\n - branch-diff --dual-color: work around bogus white-space warning\n - branch-diff: offer to dual-color the diffs\n - diff: add an internal option to dual-color diffs of diffs\n - color: provide inverted colors, too\n - branch-diff: use color for the commit pairs\n - branch-diff: add tests\n - branch-diff: do not show \"function names\" in hunk headers\n - branch-diff: adjust the output of the commit pairs\n - branch-diff: suppress the diff headers\n - branch-diff: indent the diffs just like tbdiff\n - branch-diff: right-trim commit messages\n - branch-diff: also show the diff between patches\n - branch-diff: improve the order of the shown commits\n - branch-diff: first rudimentary implementation\n - Add a new builtin: branch-diff\n - Add a function to solve least-cost assignment problems\n\n \"git tbdiff\" that lets us compare individual patches in two\n iterations of a topic has been rewritten and made into a built-in\n command.\n\n Expecting a reroll.\n cf. <nycvar.QRO.7.76.6.1805052351560.77@tvgsbejvaqbjf.bet>\n\n\n* js/sequencer-and-root-commits (2018-05-06) 6 commits\n - rebase --rebase-merges: root commits can be cousins, too\n - rebase --rebase-merges: a \"merge\" into a new root is a fast-forward\n - sequencer: allow introducing new root commits\n - rebase -i --root: let the sequencer handle even the initial part\n - sequencer: learn about the special \"fake root commit\" handling\n - sequencer: extract helper to update active_cache_tree\n (this branch uses js/rebase-recreate-merge.)\n\n The implementation of \"git rebase -i --root\" has been updated to use\n the sequencer machinery more.\n\n Will merge to 'next'.\n\n\n* js/use-bug-macro (2018-05-10) 5 commits\n - BUG_exit_code: fix sparse \"symbol not declared\" warning\n - Convert remaining die*(BUG) messages\n - Replace all die(\"BUG: ...\") calls by BUG() ones\n - run-command: use BUG() to report bugs, not die()\n - test-tool: help verifying BUG() code paths\n\n Developer support update, by using BUG() macro instead of die() to\n mark codepaths that should not happen more clearly.\n\n Will merge to 'next'.\n Further updates can come on top later.\n cf. <20180507090109.GA367@sigill.intra.peff.net>\n\n\n* jt/partial-clone-proto-v2 (2018-05-06) 4 commits\n - {fetch,upload}-pack: support filter in protocol v2\n - upload-pack: read config when serving protocol v2\n - upload-pack: fix error message typo\n - Merge branch 'bw/protocol-v2' into jt/partial-clone-proto-v2\n\n Transfer protocol v2 learned to support the partial clone.\n\n Will merge to 'next'.\n\n\n* ma/doc-expand-tabs (2018-05-02) 1 commit\n - revisions.txt: expand tabs to spaces in diagram\n\n Fix one instance of asciidoctor's misformatting by expanding a tab\n into spaces in a literal block.\n\n Will discard.  This approach is less maintainable than the approach\n taken by bc/asciidoctor-tab-width topic.\n\n\n* nd/completion-aliasfiletype-typofix (2018-05-06) 1 commit\n  (merged to 'next' on 2018-05-16 at 045e4ac190)\n + completion: fix misspelled config key aliasesfiletype\n\n Typofix.\n\n Will merge to 'master'.\n\n\n* nd/doc-header (2018-05-02) 1 commit\n  (merged to 'next' on 2018-05-16 at 0599eb3ec9)\n + doc: keep first level section header in upper case\n\n Doc formatting fix.\n\n Will merge to 'master'.\n\n\n* nd/pack-unreachable-objects-doc (2018-05-06) 1 commit\n  (merged to 'next' on 2018-05-16 at c4bf977564)\n + pack-objects: validation and documentation about unreachable options\n\n Doc update.\n\n Will merge to 'master'.\n\n\n* sb/object-store-alloc (2018-05-16) 13 commits\n - alloc: allow arbitrary repositories for alloc functions\n - object: allow create_object to handle arbitrary repositories\n - object: allow grow_object_hash to handle arbitrary repositories\n - alloc: add repository argument to alloc_commit_index\n - alloc: add repository argument to alloc_report\n - alloc: add repository argument to alloc_object_node\n - alloc: add repository argument to alloc_tag_node\n - alloc: add repository argument to alloc_commit_node\n - alloc: add repository argument to alloc_tree_node\n - alloc: add repository argument to alloc_blob_node\n - object: add repository argument to grow_object_hash\n - object: add repository argument to create_object\n - repository: introduce parsed objects field\n (this branch is used by sb/object-store-grafts; uses sb/oid-object-info.)\n\n The conversion to pass \"the_repository\" and then \"a_repository\"\n throughout the object access API continues.\n\n\n* tb/grep-column (2018-05-14) 7 commits\n - contrib/git-jump/git-jump: jump to match column in addition to line\n - grep.c: add configuration variables to show matched option\n - builtin/grep.c: add '--column' option to 'git-grep(1)'\n - grep.c: display column number of first match\n - grep.[ch]: extend grep_opt to allow showing matched column\n - grep.c: expose matched column in match_line()\n - Documentation/config.txt: camel-case lineNumber for consistency\n (this branch is used by tb/grep-only-matching.)\n\n \"git grep\" learned the \"--column\" option that gives not just the\n line number but the column number of the hit.\n\n\n* bc/asciidoctor-tab-width (2018-05-07) 2 commits\n  (merged to 'next' on 2018-05-16 at be2a42c473)\n + Documentation: render revisions correctly under Asciidoctor\n + Documentation: use 8-space tabs with Asciidoctor\n\n Asciidoctor gives a reasonable imitation for AsciiDoc, but does not\n render illustration in a literal block correctly when indented with\n HT by default. The problem is fixed by forcing 8-space tabs.\n\n Will merge to 'master'.\n\n\n* bc/mailmap-self (2018-05-08) 1 commit\n  (merged to 'next' on 2018-05-16 at a009c64bd2)\n + mailmap: update brian m. carlson's email address\n\n Will merge to 'master'.\n\n\n* cc/perf-aggregate-unknown-option (2018-04-26) 1 commit\n  (merged to 'next' on 2018-05-08 at db7d2870f8)\n + perf/aggregate: use Getopt::Long for option parsing\n\n Perf-test helper updates.\n\n Will merge to 'master'.\n\n\n* ab/perl-python-attrs (2018-04-27) 3 commits\n  (merged to 'next' on 2018-05-08 at b440e9bbb9)\n + .gitattributes: add a diff driver for Python\n + .gitattributes: use the \"perl\" differ for Perl\n + .gitattributes: add *.pl extension for Perl\n\n We learned that our source files with \".pl\" and \".py\" extensions\n are Perl and Python files respectively and changes to them are\n better viewed as such with appropriate diff drivers.\n\n Will merge to 'master'.\n\n\n* js/test-unset-prereq (2018-04-30) 1 commit\n  (merged to 'next' on 2018-05-08 at 3aecbf25a3)\n + tests: introduce test_unset_prereq, for debugging\n\n Test debugging aid.\n\n Will merge to 'master'.\n cf. <20180507115950.3887-1-szeder.dev@gmail.com>\n\n\n* fg/completion-external (2018-05-07) 1 commit\n  (merged to 'next' on 2018-05-16 at 5d83f92caf)\n + completion: load completion file for external subcommand\n\n The command line completion mechanism (in contrib/) learned to load\n custom completion file for \"git $command\" where $command is a\n custom \"git-$command\" that the end user has on the $PATH when using\n newer version of bash.\n\n Will merge to 'master'.\n cf. <CAM0VKjkTu+OkLM3gvX73mWugxArCVmqRBmWGHiKuLiLRNkkNow@mail.gmail.com>\n\n\n* js/deprecate-grafts (2018-04-30) 12 commits\n  (merged to 'next' on 2018-05-08 at 1d7b31d179)\n + Remove obsolete script to convert grafts to replace refs\n + technical/shallow: describe why shallow cannot use replace refs\n + technical/shallow: stop referring to grafts\n + filter-branch: stop suggesting to use grafts\n + Deprecate support for .git/info/grafts\n + Add a test for `git replace --convert-graft-file`\n + replace: introduce --convert-graft-file\n + replace: prepare create_graft() for converting graft files wholesale\n + replace: \"libify\" create_graft() and callees\n + replace: avoid using die() to indicate a bug\n + commit: Let the callback of for_each_mergetag return on error\n + argv_array: offer to split a string by whitespace\n\n The functionality of \"$GIT_DIR/info/grafts\" has been superseded by\n the \"refs/replace/\" mechanism for some time now, but the internal\n code had support for it in many places, which has been cleaned up\n in order to drop support of the \"grafts\" mechanism.\n\n Will merge to 'master'.\n\n\n* js/rebase-i-clean-msg-after-fixup-continue (2018-05-02) 4 commits\n  (merged to 'next' on 2018-05-08 at 7e684c153d)\n + rebase --skip: clean up commit message after a failed fixup/squash\n + sequencer: always commit without editing when asked for\n + rebase -i: Handle \"combination of <n> commits\" with GETTEXT_POISON\n + rebase -i: demonstrate bugs with fixup!/squash! commit messages\n\n \"git rebase -i\" sometimes left intermediate \"# This is a\n combination of N commits\" message meant for the human consumption\n inside an editor in the final result in certain corner cases, which\n has been fixed.\n\n Will merge to 'master'.\n\n\n* bw/server-options (2018-04-24) 4 commits\n  (merged to 'next' on 2018-05-08 at a18ce56f3c)\n + fetch: send server options when using protocol v2\n + ls-remote: send server options when using protocol v2\n + serve: introduce the server-option capability\n + Merge branch 'bw/protocol-v2' into HEAD\n\n The transport protocol v2 is getting updated further.\n\n Will merge to 'master'.\n\n\n* bc/object-id (2018-05-02) 42 commits\n - merge-one-file: compute empty blob object ID\n - add--interactive: compute the empty tree value\n - Update shell scripts to compute empty tree object ID\n - sha1_file: only expose empty object constants through git_hash_algo\n - dir: use the_hash_algo for empty blob object ID\n - sequencer: use the_hash_algo for empty tree object ID\n - cache-tree: use is_empty_tree_oid\n - sha1_file: convert cached object code to struct object_id\n - builtin/reset: convert use of EMPTY_TREE_SHA1_BIN\n - builtin/receive-pack: convert one use of EMPTY_TREE_SHA1_HEX\n - wt-status: convert two uses of EMPTY_TREE_SHA1_HEX\n - submodule: convert several uses of EMPTY_TREE_SHA1_HEX\n - sequencer: convert one use of EMPTY_TREE_SHA1_HEX\n - merge: convert empty tree constant to the_hash_algo\n - builtin/merge: switch tree functions to use object_id\n - builtin/am: convert uses of EMPTY_TREE_SHA1_BIN to the_hash_algo\n - sha1-file: add functions for hex empty tree and blob OIDs\n - builtin/receive-pack: avoid hard-coded constants for push certs\n - diff: specify abbreviation size in terms of the_hash_algo\n - upload-pack: replace use of several hard-coded constants\n - revision: replace use of hard-coded constants\n - http: eliminate hard-coded constants\n - dir: convert struct untracked_cache_dir to object_id\n - commit: convert uses of get_sha1_hex to get_oid_hex\n - index-pack: abstract away hash function constant\n - pack-redundant: convert linked lists to use struct object_id\n - Update struct index_state to use struct object_id\n - split-index: convert struct split_index to object_id\n - submodule-config: convert structures to object_id\n - fsck: convert static functions to struct object_id\n - tree-walk: convert get_tree_entry_follow_symlinks to object_id\n - tree-walk: avoid hard-coded 20 constant\n - pack-redundant: abstract away hash algorithm\n - pack-objects: abstract away hash algorithm\n - packfile: abstract away hash constant values\n - packfile: convert find_pack_entry to object_id\n - sha1-file: convert freshen functions to object_id\n - packfile: convert has_sha1_pack to object_id\n - packfile: remove unused member from struct pack_entry\n - Remove unused member in struct object_context\n - server-info: remove unused members from struct pack_info\n - cache: add a function to read an object ID from a buffer\n\n Conversion from uchar[20] to struct object_id continues.\n\n Will merge to 'next'.\n\n\n* sb/oid-object-info (2018-04-26) 9 commits\n  (merged to 'next' on 2018-05-08 at f3c08f298e)\n + cache.h: allow oid_object_info to handle arbitrary repositories\n + packfile: add repository argument to cache_or_unpack_entry\n + packfile: add repository argument to unpack_entry\n + packfile: add repository argument to read_object\n + packfile: add repository argument to packed_object_info\n + packfile: add repository argument to packed_to_object_type\n + packfile: add repository argument to retry_bad_packed_offset\n + cache.h: add repository argument to oid_object_info\n + cache.h: add repository argument to oid_object_info_extended\n (this branch is used by sb/object-store-alloc and sb/object-store-grafts.)\n\n The codepath around object-info API has been taught to take the\n repository object (which in turn tells the API which object store\n the objects are to be located).\n\n Will merge to 'master'.\n\n\n* en/unpack-trees-split-index-fix (2018-05-02) 1 commit\n  (merged to 'next' on 2018-05-16 at 1adff065b2)\n + unpack_trees: fix breakage when o->src_index != o->dst_index\n\n The split-index feature had a long-standing and dormant bug in\n certain use of the in-core merge machinery, which has been fixed.\n\n Will merge to 'master'.\n cf. <CACsJy8CeDhrT9GXe9q5gqsAeq_sSQ8jyF2nMOFxzjwKtE31oPQ@mail.gmail.com>\n\n\n* bp/merge-rename-config (2018-05-08) 3 commits\n - merge: pass aggressive when rename detection is turned off\n - merge: add merge.renames config setting\n - merge: update documentation for {merge,diff}.renameLimit\n (this branch uses en/rename-directory-detection-reboot.)\n\n With merge.renames configuration set to false, the recursive merge\n strategy can be told not to spend cycles trying to find renamed\n paths and merge them accordingly.\n\n Will merge to 'next'.\n\n\n* en/git-debugger (2018-04-25) 1 commit\n  (merged to 'next' on 2018-05-08 at 73369cd1e5)\n + Make running git under other debugger-like programs easy\n\n Dev support.\n\n Will merge to 'master'.\n\n\n* js/no-pager-shorthand (2018-05-04) 1 commit\n  (merged to 'next' on 2018-05-08 at 10e6031dd1)\n + git: add -P as a short option for --no-pager\n\n \"git --no-pager cmd\" did not have short-and-sweet single letter\n option. Now it does.\n\n Will merge to 'master'.\n\n\n* sb/diff-color-move-more (2018-04-25) 7 commits\n - diff.c: add --color-moved-ignore-space-delta option\n - diff.c: decouple white space treatment from move detection algorithm\n - diff.c: add a blocks mode for moved code detection\n - diff.c: adjust hash function signature to match hashmap expectation\n - diff.c: do not pass diff options as keydata to hashmap\n - xdiff/xdiffi.c: remove unneeded function declarations\n - xdiff/xdiff.h: remove unused flags\n\n \"git diff --color-moved\" feature has further been tweaked.\n\n Will merge to 'next'.\n\n\n* ds/generation-numbers (2018-05-02) 11 commits\n - commit-graph.txt: update design document\n - merge: check config before loading commits\n - commit: use generation number in remove_redundant()\n - commit: add short-circuit to paint_down_to_common()\n - commit: use generation numbers for in_merge_bases()\n - ref-filter: use generation number for --contains\n - commit-graph: always load commit-graph information\n - commit: use generations in paint_down_to_common()\n - commit-graph: compute generation numbers\n - commit: add generation number to struct commmit\n - ref-filter: fix outdated comment on in_commit_list\n (this branch is used by ds/commit-graph-lockfile-fix; uses ds/lazy-load-trees.)\n\n A recently added \"commit-graph\" datafile has learned to store\n pre-computed generation numbers to speed up the decisions to stop\n history traversal.\n\n Is this ready for 'next' with ds/commit-graph-lockfile-fix?\n A commit with triple 'm' needs its title amended, though.\n\n\n* en/rename-directory-detection-reboot (2018-05-08) 36 commits\n  (merged to 'next' on 2018-05-08 at be350ebc17)\n + merge-recursive: fix check for skipability of working tree updates\n + merge-recursive: make \"Auto-merging\" comment show for other merges\n + merge-recursive: fix remainder of was_dirty() to use original index\n + merge-recursive: fix was_tracked() to quit lying with some renamed paths\n + t6046: testcases checking whether updates can be skipped in a merge\n + merge-recursive: avoid triggering add_cacheinfo error with dirty mod\n + merge-recursive: move more is_dirty handling to merge_content\n + merge-recursive: improve add_cacheinfo error handling\n + merge-recursive: avoid spurious rename/rename conflict from dir renames\n + directory rename detection: new testcases showcasing a pair of bugs\n + merge-recursive: fix remaining directory rename + dirty overwrite cases\n + merge-recursive: fix overwriting dirty files involved in renames\n + merge-recursive: avoid clobbering untracked files with directory renames\n + merge-recursive: apply necessary modifications for directory renames\n + merge-recursive: when comparing files, don't include trees\n + merge-recursive: check for file level conflicts then get new name\n + merge-recursive: add computation of collisions due to dir rename & merging\n + merge-recursive: check for directory level conflicts\n + merge-recursive: add get_directory_renames()\n + merge-recursive: make a helper function for cleanup for handle_renames\n + merge-recursive: split out code for determining diff_filepairs\n + merge-recursive: make !o->detect_rename codepath more obvious\n + merge-recursive: fix leaks of allocated renames and diff_filepairs\n + merge-recursive: introduce new functions to handle rename logic\n + merge-recursive: move the get_renames() function\n + directory rename detection: tests for handling overwriting dirty files\n + directory rename detection: tests for handling overwriting untracked files\n + directory rename detection: miscellaneous testcases to complete coverage\n + directory rename detection: testcases exploring possibly suboptimal merges\n + directory rename detection: more involved edge/corner testcases\n + directory rename detection: testcases checking which side did the rename\n + directory rename detection: files/directories in the way of some renames\n + directory rename detection: partially renamed directory testcase/discussion\n + directory rename detection: testcases to avoid taking detection too far\n + directory rename detection: directory splitting testcases\n + directory rename detection: basic testcases\n (this branch is used by bp/merge-rename-config.)\n\n Rename detection logic in \"diff\" family that is used in \"merge\" has\n learned to guess when all of x/a, x/b and x/c have moved to z/a,\n z/b and z/c, it is likely that x/d added in the meantime would also\n want to move to z/d by taking the hint that the entire directory\n 'x' moved to 'z'.  A bug causing dirty files involved in a rename\n to be overwritten during merge has also been fixed as part of this\n work.  Incidentally, this also avoids updating a file in the\n working tree after a (non-trivial) merge whose result matches what\n our side originally had.\n\n Will merge to 'master'.\n\n\n* nd/command-list (2018-05-10) 13 commits\n - completion: allow to customize the completable command list\n - completion: let git provide the completable command list\n - command-list.txt: documentation and guide line\n - help: use command-list.txt for the source of guides\n - help: add \"-a --verbose\" to list all commands with synopsis\n - git: support --list-cmds=list-<category>\n - completion: implement and use --list-cmds=main,others\n - git --list-cmds: collect command list in a string_list\n - git.c: convert --list-* to --list-cmds=*\n - Remove common-cmds.h\n - help: use command-list.h for common command list\n - generate-cmds.sh: export all commands to command-list.h\n - generate-cmds.sh: factor out synopsis extract code\n\n The list of commands with their various attributes were spread\n across a few places in the build procedure, but it now is getting a\n bit more consolidated to allow more automation.\n\n Will merge to 'next'.\n\n\n* sg/complete-paths (2018-04-17) 11 commits\n  (merged to 'next' on 2018-05-08 at 2a11444f90)\n + completion: fill COMPREPLY directly when completing paths\n + completion: improve handling quoted paths in 'git ls-files's output\n + completion: remove repeated dirnames with 'awk' during path completion\n + t9902-completion: ignore COMPREPLY element order in some tests\n + completion: use 'awk' to strip trailing path components\n + completion: let 'ls-files' and 'diff-index' filter matching paths\n + completion: improve handling quoted paths on the command line\n + completion: support completing non-ASCII pathnames\n + completion: simplify prefix path component handling during path completion\n + completion: move __git_complete_index_file() next to its helpers\n + t9902-completion: add tests demonstrating issues with quoted pathnames\n\n Command line completion (in contrib/) learned to complete pathnames\n for various commands better.\n\n Will merge to 'master'.\n\n\n* sb/blame-color (2018-04-24) 3 commits\n - builtin/blame: add new coloring scheme config\n - builtin/blame: highlight recently changed lines\n - builtin/blame: dim uninteresting metadata lines\n\n \"git blame\" learns to unhighlight uninteresting metadata from the\n originating commit on lines that are the same as the previous one,\n and also paint lines in different colors depending on the age of\n the commit.\n\n Will merge to 'next'.\n\n\n* ds/lazy-load-trees (2018-05-02) 6 commits\n  (merged to 'next' on 2018-05-02 at d54016d9e3)\n + coccinelle: avoid wrong transformation suggestions from commit.cocci\n  (merged to 'next' on 2018-04-25 at b90813f421)\n + commit-graph: lazy-load trees for commits\n + treewide: replace maybe_tree with accessor methods\n + commit: create get_commit_tree() method\n + treewide: rename tree to maybe_tree\n + Merge branch 'bw/c-plus-plus' into ds/lazy-load-trees\n (this branch is used by ds/commit-graph-lockfile-fix and ds/generation-numbers.)\n\n The code has been taught to use the duplicated information stored\n in the commit-graph file to learn the tree object name for a commit\n to avoid opening and parsing the commit object when it makes sense\n to do so.\n\n Will merge to 'master'.\n\n\n* jk/branch-l-0-deprecation (2018-03-26) 3 commits\n  (merged to 'next' on 2018-04-11 at 9b2b0305dd)\n + branch: deprecate \"-l\" option\n + t: switch \"branch -l\" to \"branch --create-reflog\"\n + t3200: unset core.logallrefupdates when testing reflog creation\n (this branch is used by jk/branch-l-1-removal and jk/branch-l-2-reincarnation.)\n\n The \"-l\" option in \"git branch -l\" is an unfortunate short-hand for\n \"--create-reflog\", but many users, both old and new, somehow expect\n it to be something else, perhaps \"--list\".  This step deprecates\n the short-hand and warns about the future removal of the it when it\n is used.\n\n Will cook in 'next'.\n Perhaps merge to 'master' immediately after 2.18 release?\n\n\n* jk/branch-l-1-removal (2018-03-26) 1 commit\n - branch: drop deprecated \"-l\" option\n (this branch is used by jk/branch-l-2-reincarnation; uses jk/branch-l-0-deprecation.)\n\n Following the \"git branch -l\" deprecation, the short-hand is removed.\n\n Will keep in 'pu'.\n\n\n* jk/branch-l-2-reincarnation (2018-03-26) 1 commit\n - branch: make \"-l\" a synonym for \"--list\"\n (this branch uses jk/branch-l-0-deprecation and jk/branch-l-1-removal.)\n\n Following the \"git branch -l\" removal, \"-l\" is resurrected as a\n short-hand for \"--list\".\n\n Will keep in 'pu'.\n\n\n* nd/pack-objects-pack-struct (2018-04-16) 15 commits\n  (merged to 'next' on 2018-05-16 at 171459475d)\n + ci: exercise the whole test suite with uncommon code in pack-objects\n + pack-objects: reorder members to shrink struct object_entry\n + pack-objects: shrink delta_size field in struct object_entry\n + pack-objects: shrink size field in struct object_entry\n + pack-objects: clarify the use of object_entry::size\n + pack-objects: don't check size when the object is bad\n + pack-objects: shrink z_delta_size field in struct object_entry\n + pack-objects: refer to delta objects by index instead of pointer\n + pack-objects: move in_pack out of struct object_entry\n + pack-objects: move in_pack_pos out of struct object_entry\n + pack-objects: use bitfield for object_entry::depth\n + pack-objects: use bitfield for object_entry::dfs_state\n + pack-objects: turn type and in_pack_type to bitfields\n + pack-objects: a bit of document about struct object_entry\n + read-cache.c: make $GIT_TEST_SPLIT_INDEX boolean\n\n \"git pack-objects\" needs to allocate tons of \"struct object_entry\"\n while doing its work, and shrinking its size helps the performance\n quite a bit.\n\n Will merge to 'master'.\n cf. <CACsJy8CuVRy4UPEwXJJYAjePEz5zjKMLhRjh9UFw0DPYTzobkw@mail.gmail.com>\n\n\n* nd/repack-keep-pack (2018-04-16) 7 commits\n  (merged to 'next' on 2018-05-08 at ab906be358)\n + pack-objects: show some progress when counting kept objects\n + gc --auto: exclude base pack if not enough mem to \"repack -ad\"\n + gc: handle a corner case in gc.bigPackThreshold\n + gc: add gc.bigPackThreshold config\n + gc: add --keep-largest-pack option\n + repack: add --keep-pack option\n + t7700: have closing quote of a test at the beginning of line\n\n \"git gc\" in a large repository takes a lot of time as it considers\n to repack all objects into one pack by default.  The command has\n been taught to pretend as if the largest existing packfile is\n marked with \".keep\" so that it is left untouched while objects in\n other packs and loose ones are repacked.\n\n Will merge to 'master'.\n cf. <CACsJy8CuVRy4UPEwXJJYAjePEz5zjKMLhRjh9UFw0DPYTzobkw@mail.gmail.com>\n\n\n* tg/worktree-add-existing-branch (2018-04-30) 4 commits\n  (merged to 'next' on 2018-05-08 at 8b76505192)\n + worktree: teach \"add\" to check out existing branches\n + worktree: factor out dwim_branch function\n + worktree: improve message when creating a new worktree\n + worktree: remove extra members from struct add_opts\n\n \"git worktree add\" learned to check out an existing branch.\n\n Will merge to 'master'.\n\n\n* js/rebase-recreate-merge (2018-04-26) 17 commits\n  (merged to 'next' on 2018-05-16 at f1aeea2879)\n + rebase -i --rebase-merges: add a section to the man page\n + rebase -i: introduce --rebase-merges=[no-]rebase-cousins\n + pull: accept --rebase=merges to recreate the branch topology\n + rebase --rebase-merges: avoid \"empty merges\"\n + sequencer: handle post-rewrite for merge commands\n + sequencer: make refs generated by the `label` command worktree-local\n + rebase --rebase-merges: add test for --keep-empty\n + rebase: introduce the --rebase-merges option\n + rebase-helper --make-script: introduce a flag to rebase merges\n + sequencer: fast-forward `merge` commands, if possible\n + sequencer: introduce the `merge` command\n + sequencer: introduce new commands to reset the revision\n + git-rebase--interactive: clarify arguments\n + sequencer: offer helpful advice when a command was rescheduled\n + sequencer: refactor how original todo list lines are accessed\n + sequencer: make rearrange_squash() a bit more obvious\n + sequencer: avoid using errno clobbered by rollback_lock_file()\n (this branch is used by js/sequencer-and-root-commits.)\n\n \"git rebase\" learned \"--rebase-merges\" to transplant the whole\n topology of commit graph elsewhere.\n\n Will merge to 'master'.\n\n--------------------------------------------------\n[Discarded]\n\n* js/runtime-prefix-windows (2018-03-27) 5 commits\n . mingw/msvc: use the new-style RUNTIME_PREFIX helper\n . exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows\n . exec_cmd: RUNTIME_PREFIX on some POSIX systems\n . Makefile: add Perl runtime prefix support\n . Makefile: generate Perl header from template file\n\n The Windows port was the first that allowed Git to be installed\n anywhere by having its components refer to each other with relative\n pathnames.  The recent dj/runtime-prefix topic extends the idea to\n other platforms, and its approach has been adopted back in the\n Windows port.\n\n Ejected, as the parent topic dj/runtime-prefix covers Windows now.\n\n\n* bp/fsexcludes (2018-04-16) 2 commits\n . fsmonitor: switch to use new fsexcludes logic and remove unused untracked cache based logic\n . fsexcludes: add a programmatic way to exclude files from git's working directory traversal logic\n\n Can we have a few lines summary here, just like we have for other\n topic ;-) I personally take the overlong title of these commits as\n a sign that they can further be simplified and cleaned up by\n splitting, focusing the scope, etc.\n\n Retracted.\n cf. <0de30972-b0a2-67e8-7cff-c19daf9ece8b@gmail.com>\n"},{"id":"347898","messageId":"e440f6e0-6d7d-0e72-b875-de290cea6b94@gmail.com","threadId":"48510","inReplyTo":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","subject":"jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-17T06:39:51Z","receivedAt":"2018-05-17T06:40:06Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Thursday 17 May 2018 11:31 AM, Junio C Hamano wrote:\n> * jk/branch-l-0-deprecation (2018-03-26) 3 commits\n> \n> ...\n>\n>  The \"-l\" option in \"git branch -l\" is an unfortunate short-hand for\n>  \"--create-reflog\", but many users, both old and new, somehow expect\n>  it to be something else, perhaps \"--list\".  This step deprecates\n>  the short-hand and warns about the future removal of the it when it\n>  is used.\n> \n>  Will cook in 'next'.\n>  Perhaps merge to 'master' immediately after 2.18 release?\n\nI still have a slight feeling that we shouldn't list the branches for\n\"git branch -l\" during the deprecation period. If feel this because\n\n\ti) It would avoid confusions for the users during the\n\t   deprecation period\n\n\tii) The warning message seems to add to the confusion:\n\n\t    $ git branch -l\n\t    warning: the '-l' alias for '--create-reflog' is deprecated;\n\t    warning: it will be removed in a future version of Git\n\t    * master\n\t    ...\n\n\n\t    If there are ample branches, the warning message might be\n\t    hidden out of screen but we shouldn't rely on that, I\n\t    suppose.\n\n\n-- \nSivaraam\n\nQUOTE:\n\n“The most valuable person on any team is the person who makes everyone\nelse on the team more valuable, not the person who knows the most.”\n\n      - John Sonmez\n\n\nSivaraam?\n\nYou possibly might have noticed that my signature recently changed from\n'Kaartic' to 'Sivaraam' both of which are parts of my name. I find the\nnew signature to be better for several reasons one of which is that the\nformer signature has a lot of ambiguities in the place I live as it is a\ncommon name (NOTE: it's not a common spelling, just a common name). So,\nI switched signatures before it's too late.\n\nThat said, I won't mind you calling me 'Kaartic' if you like it [of\ncourse ;-)]. You can always call me using either of the names.\n\n\nKIND NOTE TO THE NATIVE ENGLISH SPEAKER:\n\nAs I'm not a native English speaker myself, there might be mistaeks in\nmy usage of English. I apologise for any mistakes that I make.\n\nIt would be \"helpful\" if you take the time to point out the mistakes.\n\nIt would be \"super helpful\" if you could provide suggestions about how\nto correct those mistakes.\n\nThanks in advance!\n\n"},{"id":"347902","messageId":"87fu2qbojy.fsf@evledraar.gmail.com","threadId":"48510","inReplyTo":"e440f6e0-6d7d-0e72-b875-de290cea6b94@gmail.com","subject":"Re: jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-05-17T09:48:33Z","receivedAt":"2018-05-17T09:48:40Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, May 17 2018, Kaartic Sivaraam wrote:\n\n> On Thursday 17 May 2018 11:31 AM, Junio C Hamano wrote:\n>> * jk/branch-l-0-deprecation (2018-03-26) 3 commits\n>>\n>> ...\n>>\n>>  The \"-l\" option in \"git branch -l\" is an unfortunate short-hand for\n>>  \"--create-reflog\", but many users, both old and new, somehow expect\n>>  it to be something else, perhaps \"--list\".  This step deprecates\n>>  the short-hand and warns about the future removal of the it when it\n>>  is used.\n>>\n>>  Will cook in 'next'.\n>>  Perhaps merge to 'master' immediately after 2.18 release?\n>\n> I still have a slight feeling that we shouldn't list the branches for\n> \"git branch -l\" during the deprecation period. If feel this because\n>\n> \ti) It would avoid confusions for the users during the\n> \t   deprecation period\n>\n> \tii) The warning message seems to add to the confusion:\n>\n> \t    $ git branch -l\n> \t    warning: the '-l' alias for '--create-reflog' is deprecated;\n> \t    warning: it will be removed in a future version of Git\n> \t    * master\n> \t    ...\n>\n>\n> \t    If there are ample branches, the warning message might be\n> \t    hidden out of screen but we shouldn't rely on that, I\n> \t    suppose.\n\nAlso if we have lots of branches, depending on your pager settings you\nwon't see this at all, I have:\n\n    PAGER=less LESS=\"--IGNORE-CASE --LONG-PROMPT --QUIET --chop-long-lines --RAW-CONTROL-CHARS --no-init --quit-if-one-screen\"\n\nI've ended up with that $LESS setting via hackery over the years, so\nmaybe I'm doing something retarded, minimal test case:\n\n    PAGER=less  LESS=\"--no-init --quit-if-one-screen\" git branch -l\n\nSo with those two options I don't get the stderr output at all, but if I\nremove either one of those options once I quit the pager I get the\noutput at the end.\n\nSo I think this is probably OK for most users, if the have very few\nbranches they'll see it, and then if they use default pager settings\nthey'll see the stderr output once they quit the pager. I don't know how\ncommon my (mis)configuration is.\n"},{"id":"347904","messageId":"57e90df8-9522-0988-f25d-59a132b5afbe@gmail.com","threadId":"48510","inReplyTo":"87fu2qbojy.fsf@evledraar.gmail.com","subject":"Re: jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-17T11:00:57Z","receivedAt":"2018-05-17T11:01:35Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"Hi Ævar,\n\nOn Thursday 17 May 2018 03:18 PM, Ævar Arnfjörð Bjarmason wrote:\n> I've ended up with that $LESS setting via hackery over the years, so\n> maybe I'm doing something retarded, minimal test case:\n> \n>     PAGER=less  LESS=\"--no-init --quit-if-one-screen\" git branch -l\n>\n> ...\n> \n> So I think this is probably OK for most users, if the have very few\n> branches they'll see it, and then if they use default pager settings\n> they'll see the stderr output once they quit the pager. I don't know how\n> common my (mis)configuration is.\n>\nI'm not sure this is ok, because I still see the stderr output with your\nminimal test case even when I have enough branches to not fit in one\nscreen. The stderr output is of course above the pager output (after I\nquit the pager) and gets hidden out-of display as I stated before. I\nalso get weird 'ESC[m' characters with you minimal test case. I'm not\nsure what I'm missing.\n\nWhat version of 'less' do you use? Is any other configuration that you\ndidn't mention affecting what your observation?\n\n\n-- \nSivaraam\n\nQUOTE:\n\n“The most valuable person on any team is the person who makes everyone\nelse on the team more valuable, not the person who knows the most.”\n\n      - John Sonmez\n\n\nSivaraam?\n\nYou possibly might have noticed that my signature recently changed from\n'Kaartic' to 'Sivaraam' both of which are parts of my name. I find the\nnew signature to be better for several reasons one of which is that the\nformer signature has a lot of ambiguities in the place I live as it is a\ncommon name (NOTE: it's not a common spelling, just a common name). So,\nI switched signatures before it's too late.\n\nThat said, I won't mind you calling me 'Kaartic' if you like it [of\ncourse ;-)]. You can always call me using either of the names.\n\n\nKIND NOTE TO THE NATIVE ENGLISH SPEAKER:\n\nAs I'm not a native English speaker myself, there might be mistaeks in\nmy usage of English. I apologise for any mistakes that I make.\n\nIt would be \"helpful\" if you take the time to point out the mistakes.\n\nIt would be \"super helpful\" if you could provide suggestions about how\nto correct those mistakes.\n\nThanks in advance!\n\n"},{"id":"347905","messageId":"87d0xubidb.fsf@evledraar.gmail.com","threadId":"48510","inReplyTo":"57e90df8-9522-0988-f25d-59a132b5afbe@gmail.com","subject":"Re: jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-05-17T12:02:08Z","receivedAt":"2018-05-17T12:02:15Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, May 17 2018, Kaartic Sivaraam wrote:\n\n> Hi Ævar,\n>\n> On Thursday 17 May 2018 03:18 PM, Ævar Arnfjörð Bjarmason wrote:\n>> I've ended up with that $LESS setting via hackery over the years, so\n>> maybe I'm doing something retarded, minimal test case:\n>>\n>>     PAGER=less  LESS=\"--no-init --quit-if-one-screen\" git branch -l\n>>\n>> ...\n>>\n>> So I think this is probably OK for most users, if the have very few\n>> branches they'll see it, and then if they use default pager settings\n>> they'll see the stderr output once they quit the pager. I don't know how\n>> common my (mis)configuration is.\n>>\n> I'm not sure this is ok, because I still see the stderr output with your\n> minimal test case even when I have enough branches to not fit in one\n> screen. The stderr output is of course above the pager output (after I\n> quit the pager) and gets hidden out-of display as I stated before. I\n> also get weird 'ESC[m' characters with you minimal test case. I'm not\n> sure what I'm missing.\n\nI don't get it anywhere, above or below.\n\n> What version of 'less' do you use? Is any other configuration that you\n> didn't mention affecting what your observation?\n\nBoth \"less 481 (GNU regular expressions)\" and version 487. I upgraded\nand tried both. This is on Debian stable (and newer version from\ntesting).\n\nIt may be something in my system config, but I tried sudo-ing to a user\nthat only has stock Debian config & none of my custom .bashrc etc, and I\nget the same thing.\n"},{"id":"347908","messageId":"759723ec-3f48-bdf6-2edd-6f69d1e7d12c@gmail.com","threadId":"48510","inReplyTo":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2018-05-17T13:22:18Z","receivedAt":"2018-05-17T13:22:24Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 5/17/2018 2:01 AM, Junio C Hamano wrote:\n> * ds/generation-numbers (2018-05-02) 11 commits\n>   - commit-graph.txt: update design document\n>   - merge: check config before loading commits\n>   - commit: use generation number in remove_redundant()\n>   - commit: add short-circuit to paint_down_to_common()\n>   - commit: use generation numbers for in_merge_bases()\n>   - ref-filter: use generation number for --contains\n>   - commit-graph: always load commit-graph information\n>   - commit: use generations in paint_down_to_common()\n>   - commit-graph: compute generation numbers\n>   - commit: add generation number to struct commmit\n>   - ref-filter: fix outdated comment on in_commit_list\n>   (this branch is used by ds/commit-graph-lockfile-fix; uses ds/lazy-load-trees.)\n>\n>   A recently added \"commit-graph\" datafile has learned to store\n>   pre-computed generation numbers to speed up the decisions to stop\n>   history traversal.\n>\n>   Is this ready for 'next' with ds/commit-graph-lockfile-fix?\n>   A commit with triple 'm' needs its title amended, though.\n\nWith the lockfile fix, it should be ready. I've been giving this \nsignificant testing on my machine and a few other developers here. The \nnext version of GVFS is shipping with this code and with GVFS \ncontrolling the maintenance of the commit-graph file. That code has been \ncooking with our CI builds for a while, with full functional tests \nagainst the Windows repository. The only bugs we've found are the fix in \n\"merge: check config before loading commits\" and in \nds/commit-graph-lockfile-fix.\n\nSorry for the triple-m.\n\nThanks,\n-Stolee\n"},{"id":"347909","messageId":"20180517133601.GC17548@sigill.intra.peff.net","threadId":"48510","inReplyTo":"87fu2qbojy.fsf@evledraar.gmail.com","subject":"Re: jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-17T13:36:02Z","receivedAt":"2018-05-17T13:36:08Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 17, 2018 at 11:48:33AM +0200, Ævar Arnfjörð Bjarmason wrote:\n\n> > \t    If there are ample branches, the warning message might be\n> > \t    hidden out of screen but we shouldn't rely on that, I\n> > \t    suppose.\n> \n> Also if we have lots of branches, depending on your pager settings you\n> won't see this at all, I have:\n\nWe redirect stderr to the pager, as well, exactly to catch this sort of\ncase. But because git-branch does not kick in the pager until later\n(because it only wants to do it for list-mode), that happens _after_\nwe've emitted the message.\n\nSo one fix would be to teach deprecated_reflog_option_cb() to just set a\nflag rather than printing the warning, and then issue the warning.\nSomething like this:\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 452742fecf..f51b89e962 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -34,6 +34,7 @@ static const char * const builtin_branch_usage[] = {\n \tNULL\n };\n \n+static int used_deprecated_reflog_option;\n static const char *head;\n static struct object_id head_oid;\n \n@@ -576,8 +577,7 @@ static int edit_branch_description(const char *branch_name)\n static int deprecated_reflog_option_cb(const struct option *opt,\n \t\t\t\t       const char *arg, int unset)\n {\n-\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n-\twarning(\"it will be removed in a future version of Git\");\n+\tused_deprecated_reflog_option = 1;\n \t*(int *)opt->value = !unset;\n \treturn 0;\n }\n@@ -703,6 +703,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n+\tif (used_deprecated_reflog_option) {\n+\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n+\t\twarning(\"it will be removed in a future version of Git\");\n+\t}\n+\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n\nOn the other hand, I'm not sure this is that big a deal. The point of\nthe deprecation warning is to catch people who are actually trying to\nuse \"-l\" as \"--create-reflog\", and that case does not page. The people\ndoing \"git branch -l\" are actually getting what they want eventually,\nwhich is to turn it into \"--list\". In the interim step where it becomes\nan unknown option, they'll get a hard error.\n\n-Peff\n"},{"id":"347917","messageId":"CAGZ79kY1DOgrbkgUWHb+5KSBjrupHod0n8SU6M+xMnBGjMTmZQ@mail.gmail.com","threadId":"48510","inReplyTo":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T18:20:57Z","receivedAt":"2018-05-17T18:21:02Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"> * sb/object-store-replace (2018-05-10) 2 commits\n>   (merged to 'next' on 2018-05-16 at 41bbedcc81)\n>  + replace-object.c: remove the_repository from prepare_replace_object\n>  + object.c: free replace map in raw_object_store_clear\n>\n>  Hotfix.\n>\n>  Will merge to 'master'.\n\nPlease do not.\n(Or do, but then be prepared for another hotfix.)\n\nThe commit sb/object-store-replace^ needs more free'ing and shall be\nreplaced with\nhttps://public-inbox.org/git/20180510195849.28023-4-sbeller@google.com/\nI'll resend shortly.\n\n>\n> * sb/submodule-merge-in-merge-recursive (2018-05-16) 3 commits\n>  - merge-recursive: give notice when submodule commit gets fast-forwarded\n>  - merge-recursive: i18n submodule merge output and respect verbosity\n>  - submodule.c: move submodule merging to merge-recursive.c\n>\n>  By code restructuring of submodule merge in merge-recursive,\n>  informational messages from the codepath are now given using the\n>  same mechanism as other output, and honor the merge.verbosity\n>  configuration.  The code also learned to give a few new messages\n>  when a submodule three-way merge resolves cleanly when one side\n>  records a descendant of the commit chosen by the other side.\n>\n>  Will merge to 'next'.\n\nMerging would be ok, but I would rather not.\nA resend will be only for cosmetic effect, as I messed up the last commit\n\nSo, please hold in pu.\n\n> * sb/diff-color-move-more (2018-04-25) 7 commits\n>  - diff.c: add --color-moved-ignore-space-delta option\n>  - diff.c: decouple white space treatment from move detection algorithm\n>  - diff.c: add a blocks mode for moved code detection\n>  - diff.c: adjust hash function signature to match hashmap expectation\n>  - diff.c: do not pass diff options as keydata to hashmap\n>  - xdiff/xdiffi.c: remove unneeded function declarations\n>  - xdiff/xdiff.h: remove unused flags\n>\n>  \"git diff --color-moved\" feature has further been tweaked.\n>\n>  Will merge to 'next'.\n\nI did not get around to fix it up, there are still review\ncomments outstanding. (The test is broken in the last commit.)\n\nPlease hold in pu;\n\nThanks,\nStefan\n"},{"id":"347918","messageId":"20180517182959.22961-1-sbeller@google.com","threadId":"48510","inReplyTo":"CAGZ79kY1DOgrbkgUWHb+5KSBjrupHod0n8SU6M+xMnBGjMTmZQ@mail.gmail.com","subject":"[PATCH 0/2] Reroll 2 last commits of sb/object-store-replace","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T18:29:57Z","receivedAt":"2018-05-17T18:30:07Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":">> * sb/object-store-replace (2018-05-10) 2 commits\n>>   (merged to 'next' on 2018-05-16 at 41bbedcc81)\n>>  + replace-object.c: remove the_repository from prepare_replace_object\n>>  + object.c: free replace map in raw_object_store_clear\n>>\n>>  Hotfix.\n>>\n>>  Will merge to 'master'.\n>\n>Please do not.\n\nHere comes a reroll with another fix, diff below, as the branch-diff did\nnot give a good output[1].\n\nThanks,\nStefan \n\n$ git diff origin/sb/object-store-replace\ndiff --git c/object.c w/object.c\nindex cdf520084df..97245fdea25 100644\n--- c/object.c\n+++ w/object.c\n@@ -480,6 +480,8 @@ void raw_object_store_clear(struct raw_object_store *o)\n {\n        FREE_AND_NULL(o->objectdir);\n        FREE_AND_NULL(o->alternate_db);\n+\n+       oidmap_free(o->replace_map, 1);\n        FREE_AND_NULL(o->replace_map);\n \n        free_alt_odbs(o);\n\n[1]\n$ ./git-branch-diff origin/sb/object-store-replace^^..origin/sb/object-store-replace sb/object-store-replace^^..sb/object-store-replace\n1:  d5873072054 < -:  ----------- object.c: free replace map in raw_object_store_clear\n-:  ----------- > 1:  88d456c5d24 object.c: free replace map in raw_object_store_clear\n2:  74fd0705bb3 = 2:  6da07fe2f9c replace-object.c: remove the_repository from prepare_replace_object\n\nStefan Beller (2):\n  object.c: free replace map in raw_object_store_clear\n  replace-object.c: remove the_repository from prepare_replace_object\n\n object.c         | 3 +++\n replace_object.c | 2 +-\n 2 files changed, 4 insertions(+), 1 deletion(-)\n\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347919","messageId":"20180517182959.22961-2-sbeller@google.com","threadId":"48510","inReplyTo":"20180517182959.22961-1-sbeller@google.com","subject":"[PATCH 1/2] object.c: free replace map in raw_object_store_clear","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T18:29:58Z","receivedAt":"2018-05-17T18:30:09Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The replace map for objects was missed to free in the object store in\nthe conversion of c1274495 (\"replace-object: eliminate replace objects\nprepared flag\", 2018-04-11). We also missed to free the replaced objects\nthat are put into the replace map in that whole series.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n object.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/object.c b/object.c\nindex 66cffaf6e51..97245fdea25 100644\n--- a/object.c\n+++ b/object.c\n@@ -481,6 +481,9 @@ void raw_object_store_clear(struct raw_object_store *o)\n \tFREE_AND_NULL(o->objectdir);\n \tFREE_AND_NULL(o->alternate_db);\n \n+\toidmap_free(o->replace_map, 1);\n+\tFREE_AND_NULL(o->replace_map);\n+\n \tfree_alt_odbs(o);\n \to->alt_odb_tail = NULL;\n \n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347920","messageId":"20180517182959.22961-3-sbeller@google.com","threadId":"48510","inReplyTo":"20180517182959.22961-1-sbeller@google.com","subject":"[PATCH 2/2] replace-object.c: remove the_repository from prepare_replace_object","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T18:29:59Z","receivedAt":"2018-05-17T18:30:10Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This was missed in 5982da9d2ce (replace-object: allow\nprepare_replace_object to handle arbitrary repositories, 2018-04-11)\n\nTechnically the code works correctly as the replace_map is the same\nsize in different repositories, however it is hard to read. So convert\nthe code to the familiar pattern of dereferencing the pointer that we\nassign in the sizeof itself.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n replace_object.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/replace_object.c b/replace_object.c\nindex 246b98cd4f1..801b5c16789 100644\n--- a/replace_object.c\n+++ b/replace_object.c\n@@ -37,7 +37,7 @@ static void prepare_replace_object(struct repository *r)\n \t\treturn;\n \n \tr->objects->replace_map =\n-\t\txmalloc(sizeof(*the_repository->objects->replace_map));\n+\t\txmalloc(sizeof(*r->objects->replace_map));\n \toidmap_init(r->objects->replace_map, 0);\n \n \tfor_each_replace_ref(r, register_replace_ref, NULL);\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347921","messageId":"20180517184008.25445-1-sbeller@google.com","threadId":"48510","inReplyTo":"CAGZ79kY1DOgrbkgUWHb+5KSBjrupHod0n8SU6M+xMnBGjMTmZQ@mail.gmail.com","subject":"[PATCH] merge-recursive: give notice when submodule commit gets fast-forwarded","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T18:40:08Z","receivedAt":"2018-05-17T18:40:23Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"From: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n\nInform the user about an automatically fast-forwarded submodule. The\nsilent merge behavior was introduced by commit 68d03e4a6e44 (\"Implement\nautomatic fast-forward merge for submodules\", 2010-07-07)).\n\nSigned-off-by: Leif Middelschulte <Leif.Middelschulte@gmail.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n merge-recursive.c | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\n>> * sb/submodule-merge-in-merge-recursive (2018-05-16) 3 commits\n>>  - merge-recursive: give notice when submodule commit gets fast-forwarded\n>>  - merge-recursive: i18n submodule merge output and respect verbosity\n>>  - submodule.c: move submodule merging to merge-recursive.c\n>>\n>>  By code restructuring of submodule merge in merge-recursive,\n>>  informational messages from the codepath are now given using the\n>>  same mechanism as other output, and honor the merge.verbosity\n>>  configuration.  The code also learned to give a few new messages\n>>  when a submodule three-way merge resolves cleanly when one side\n>>  records a descendant of the commit chosen by the other side.\n>>\n>>  Will merge to 'next'.\n>\n>Merging would be ok, but I would rather not.\n>A resend will be only for cosmetic effect, as I messed up the last commit\n>\n>So, please hold in pu.\n\nThis is the resend, with an interdiff as follows.\n\nJunio wrote in http://public-inbox.org/git/xmqqk1s474vx.fsf@gitster-ct.c.googlers.com:\n\n> Perhaps Leif can elaborate why this change is a good idea in the\n> first place?\n\nwhich is also outstanding.\n\nLeif can you pick this patch and resend it with a proper commit message?\n\n\n    # diff --git c/merge-recursive.c w/merge-recursive.c\n    # index 29a430c418a..a9aecccb8c3 100644\n    # --- c/merge-recursive.c\n    # +++ w/merge-recursive.c\n    # @@ -1094,7 +1094,7 @@ static int merge_submodule(struct merge_options *o,\n    #  \tif (in_merge_bases(commit_a, commit_b)) {\n    #  \t\toidcpy(result, b);\n    #  \t\tif (show(o, 3)) {\n    # -\t\t\toutput(o, 1, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n    # +\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n    #  \t\t\toutput_commit_title(o, commit_b);\n    #  \t\t} else if (show(o, 2))\n    #  \t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(b));\n    # @@ -1106,7 +1106,7 @@ static int merge_submodule(struct merge_options *o,\n    #  \tif (in_merge_bases(commit_b, commit_a)) {\n    #  \t\toidcpy(result, a);\n    #  \t\tif (show(o, 3)) {\n    # -\t\t\toutput(o, 1, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n    # +\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n    #  \t\t\toutput_commit_title(o, commit_a);\n    #  \t\t} else if (show(o, 2))\n    #  \t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(a));\n\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex 0571919ee0a..a9aecccb8c3 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1093,10 +1093,26 @@ static int merge_submodule(struct merge_options *o,\n \t/* Case #1: a is contained in b or vice versa */\n \tif (in_merge_bases(commit_a, commit_b)) {\n \t\toidcpy(result, b);\n+\t\tif (show(o, 3)) {\n+\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n+\t\t\toutput_commit_title(o, commit_b);\n+\t\t} else if (show(o, 2))\n+\t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(b));\n+\t\telse\n+\t\t\t; /* no output */\n+\n \t\treturn 1;\n \t}\n \tif (in_merge_bases(commit_b, commit_a)) {\n \t\toidcpy(result, a);\n+\t\tif (show(o, 3)) {\n+\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n+\t\t\toutput_commit_title(o, commit_a);\n+\t\t} else if (show(o, 2))\n+\t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(a));\n+\t\telse\n+\t\t\t; /* no output */\n+\n \t\treturn 1;\n \t}\n \n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347922","messageId":"20180517194653.48928-1-sbeller@google.com","threadId":"48510","inReplyTo":"CAGZ79kY1DOgrbkgUWHb+5KSBjrupHod0n8SU6M+xMnBGjMTmZQ@mail.gmail.com","subject":"[PATCH 0/8] Reroll of sb/diff-color-move-more","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:45Z","receivedAt":"2018-05-17T19:47:07Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":">> * sb/diff-color-move-more (2018-04-25) 7 commits\n>...\n>>\n>>  Will merge to 'next'.\n>\n>I did not get around to fix it up, there are still review\n>comments outstanding. (The test is broken in the last commit.)\n\nThis is a reroll of sb/diff-color-move-more, with the test fixed as well\nas another extra patch, that would have caught the bad test. \n\nThe range diff is below.\n\nThanks,\nStefan\n\nStefan Beller (8):\n  xdiff/xdiff.h: remove unused flags\n  xdiff/xdiffi.c: remove unneeded function declarations\n  diff.c: do not pass diff options as keydata to hashmap\n  diff.c: adjust hash function signature to match hashmap expectation\n  diff.c: add a blocks mode for moved code detection\n  diff.c: decouple white space treatment from move detection algorithm\n  diff.c: add --color-moved-ignore-space-delta option\n  diff: color-moved white space handling options imply color-moved\n\n Documentation/diff-options.txt |  25 ++++-\n diff.c                         | 138 +++++++++++++++++++----\n diff.h                         |   8 +-\n t/t4015-diff-whitespace.sh     | 197 +++++++++++++++++++++++++++++++--\n xdiff/xdiff.h                  |   8 --\n xdiff/xdiffi.c                 |  17 ---\n 6 files changed, 336 insertions(+), 57 deletions(-)\n\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n1:  a7a7af6b76b = 1:  a7a7af6b76b xdiff/xdiff.h: remove unused flags\n2:  a7b6aaf7bc0 = 2:  a7b6aaf7bc0 xdiff/xdiffi.c: remove unneeded function declarations\n3:  d9e57cc6b05 = 3:  d9e57cc6b05 diff.c: do not pass diff options as keydata to hashmap\n4:  87111ba726d = 4:  87111ba726d diff.c: adjust hash function signature to match hashmap expectation\n5:  9559b8cb456 = 5:  9559b8cb456 diff.c: add a blocks mode for moved code detection\n6:  41a70464209 = 6:  41a70464209 diff.c: decouple white space treatment from move detection algorithm\n7:  c0114b2ce56 ! 7:  72bb8213cab diff.c: add --color-moved-ignore-space-delta option\n    @@ -6,7 +6,6 @@\n         changes uniformly.\n     \n         Signed-off-by: Stefan Beller <sbeller@google.com>\n    -    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n     \n     diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n     --- a/Documentation/diff-options.txt\n    @@ -237,7 +236,7 @@\n     +\tnot adjust\n     +\tEOF\n     +\n    -+\tgit diff --color --color-moved-ignore-space-prefix-delta |\n    ++\tgit diff --color --color-moved --color-moved-ignore-space-prefix-delta |\n     +\t\tgrep -v \"index\" |\n     +\t\ttest_decode_color >actual &&\n     +\n    @@ -246,20 +245,20 @@\n     +\t\t<BOLD>--- a/text.txt<RESET>\n     +\t\t<BOLD>+++ b/text.txt<RESET>\n     +\t\t<CYAN>@@ -1,7 +1,7 @@<RESET>\n    -+\t\t<RED>-QIndented<RESET>\n    -+\t\t<RED>-QText across<RESET>\n    -+\t\t<RED>-Qthree lines<RESET>\n    ++\t\t<BOLD;MAGENTA>-QIndented<RESET>\n    ++\t\t<BOLD;MAGENTA>-QText across<RESET>\n    ++\t\t<BOLD;MAGENTA>-Qthree lines<RESET>\n     +\t\t<RED>-QBut! <- this stands out<RESET>\n    -+\t\t<RED>-Qthis one<RESET>\n    -+\t\t<RED>-QQline did<RESET>\n    -+\t\t<RED>-Qnot adjust<RESET>\n    -+\t\t<GREEN>+<RESET>QQ<GREEN>Indented<RESET>\n    -+\t\t<GREEN>+<RESET>QQ<GREEN>Text across<RESET>\n    -+\t\t<GREEN>+<RESET>QQ<GREEN>three lines<RESET>\n    ++\t\t<BOLD;MAGENTA>-Qthis one<RESET>\n    ++\t\t<BOLD;MAGENTA>-QQline did<RESET>\n    ++\t\t<BOLD;MAGENTA>-Qnot adjust<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>Indented<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>Text across<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>three lines<RESET>\n     +\t\t<GREEN>+<RESET>QQQ<GREEN>But! <- this stands out<RESET>\n    -+\t\t<GREEN>+<RESET><GREEN>this one<RESET>\n    -+\t\t<GREEN>+<RESET>Q<GREEN>line did<RESET>\n    -+\t\t<GREEN>+<RESET><GREEN>not adjust<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET><BOLD;YELLOW>this one<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>line did<RESET>\n    ++\t\t<BOLD;YELLOW>+<RESET><BOLD;YELLOW>not adjust<RESET>\n     +\tEOF\n     +\n     +\ttest_cmp expected actual\n-:  ----------- > 8:  9e0508c8381 diff: color-moved white space handling options imply color-moved\n"},{"id":"347923","messageId":"20180517194653.48928-2-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 1/8] xdiff/xdiff.h: remove unused flags","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:46Z","receivedAt":"2018-05-17T19:47:10Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"These flags were there since the beginning (3443546f6e (Use a *real*\nbuilt-in diff generator, 2006-03-24), but were never used. Remove them.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n xdiff/xdiff.h | 8 --------\n 1 file changed, 8 deletions(-)\n\ndiff --git a/xdiff/xdiff.h b/xdiff/xdiff.h\nindex c1937a29112..2356da5f784 100644\n--- a/xdiff/xdiff.h\n+++ b/xdiff/xdiff.h\n@@ -52,14 +52,6 @@ extern \"C\" {\n #define XDL_EMIT_FUNCNAMES (1 << 0)\n #define XDL_EMIT_FUNCCONTEXT (1 << 2)\n \n-#define XDL_MMB_READONLY (1 << 0)\n-\n-#define XDL_MMF_ATOMIC (1 << 0)\n-\n-#define XDL_BDOP_INS 1\n-#define XDL_BDOP_CPY 2\n-#define XDL_BDOP_INSB 3\n-\n /* merge simplification levels */\n #define XDL_MERGE_MINIMAL 0\n #define XDL_MERGE_EAGER 1\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347924","messageId":"20180517194653.48928-3-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 2/8] xdiff/xdiffi.c: remove unneeded function declarations","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:47Z","receivedAt":"2018-05-17T19:47:12Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"There is no need to forward-declare these functions, as they are used\nafter their implementation only.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n xdiff/xdiffi.c | 17 -----------------\n 1 file changed, 17 deletions(-)\n\ndiff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c\nindex 0de1ef463bf..3e8aff92bc4 100644\n--- a/xdiff/xdiffi.c\n+++ b/xdiff/xdiffi.c\n@@ -22,34 +22,17 @@\n \n #include \"xinclude.h\"\n \n-\n-\n #define XDL_MAX_COST_MIN 256\n #define XDL_HEUR_MIN_COST 256\n #define XDL_LINE_MAX (long)((1UL << (CHAR_BIT * sizeof(long) - 1)) - 1)\n #define XDL_SNAKE_CNT 20\n #define XDL_K_HEUR 4\n \n-\n-\n typedef struct s_xdpsplit {\n \tlong i1, i2;\n \tint min_lo, min_hi;\n } xdpsplit_t;\n \n-\n-\n-\n-static long xdl_split(unsigned long const *ha1, long off1, long lim1,\n-\t\t      unsigned long const *ha2, long off2, long lim2,\n-\t\t      long *kvdf, long *kvdb, int need_min, xdpsplit_t *spl,\n-\t\t      xdalgoenv_t *xenv);\n-static xdchange_t *xdl_add_change(xdchange_t *xscr, long i1, long i2, long chg1, long chg2);\n-\n-\n-\n-\n-\n /*\n  * See \"An O(ND) Difference Algorithm and its Variations\", by Eugene Myers.\n  * Basically considers a \"box\" (off1, off2, lim1, lim2) and scan from both\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347925","messageId":"20180517194653.48928-5-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 4/8] diff.c: adjust hash function signature to match hashmap expectation","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:49Z","receivedAt":"2018-05-17T19:47:16Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This makes the follow up patch easier.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n diff.c | 16 +++++++++-------\n 1 file changed, 9 insertions(+), 7 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex ce7bedc1b92..d1bae900cdc 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -707,11 +707,15 @@ struct moved_entry {\n \tstruct moved_entry *next_line;\n };\n \n-static int moved_entry_cmp(const struct diff_options *diffopt,\n-\t\t\t   const struct moved_entry *a,\n-\t\t\t   const struct moved_entry *b,\n+static int moved_entry_cmp(const void *hashmap_cmp_fn_data,\n+\t\t\t   const void *entry,\n+\t\t\t   const void *entry_or_key,\n \t\t\t   const void *keydata)\n {\n+\tconst struct diff_options *diffopt = hashmap_cmp_fn_data;\n+\tconst struct moved_entry *a = entry;\n+\tconst struct moved_entry *b = entry_or_key;\n+\n \treturn !xdiff_compare_lines(a->es->line, a->es->len,\n \t\t\t\t    b->es->line, b->es->len,\n \t\t\t\t    diffopt->xdl_opts);\n@@ -5534,10 +5538,8 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)\n \t\tif (o->color_moved) {\n \t\t\tstruct hashmap add_lines, del_lines;\n \n-\t\t\thashmap_init(&del_lines,\n-\t\t\t\t     (hashmap_cmp_fn)moved_entry_cmp, o, 0);\n-\t\t\thashmap_init(&add_lines,\n-\t\t\t\t     (hashmap_cmp_fn)moved_entry_cmp, o, 0);\n+\t\t\thashmap_init(&del_lines, moved_entry_cmp, o, 0);\n+\t\t\thashmap_init(&add_lines, moved_entry_cmp, o, 0);\n \n \t\t\tadd_lines_to_move_detection(o, &add_lines, &del_lines);\n \t\t\tmark_color_as_moved(o, &add_lines, &del_lines);\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347926","messageId":"20180517194653.48928-6-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 5/8] diff.c: add a blocks mode for moved code detection","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:50Z","receivedAt":"2018-05-17T19:47:18Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The new \"blocks\" mode provides a middle ground between plain and zebra.\nIt is as intuitive (few colors) as plain, but still has the requirement\nfor a minimum of lines/characters to count a block as moved.\n\nSuggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n (https://public-inbox.org/git/87o9j0uljo.fsf@evledraar.gmail.com/)\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/diff-options.txt |  8 ++++--\n diff.c                         |  6 +++--\n diff.h                         |  5 ++--\n t/t4015-diff-whitespace.sh     | 48 +++++++++++++++++++++++++++++++++-\n 4 files changed, 60 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex e3a44f03cdc..bb9f1b7cd82 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -276,10 +276,14 @@ plain::\n \tthat are added somewhere else in the diff. This mode picks up any\n \tmoved line, but it is not very useful in a review to determine\n \tif a block of code was moved without permutation.\n-zebra::\n+blocks:\n \tBlocks of moved text of at least 20 alphanumeric characters\n \tare detected greedily. The detected blocks are\n-\tpainted using either the 'color.diff.{old,new}Moved' color or\n+\tpainted using either the 'color.diff.{old,new}Moved' color.\n+\tAdjacent blocks cannot be told apart.\n+zebra::\n+\tBlocks of moved text are detected as in 'blocks' mode. The blocks\n+\tare painted using either the 'color.diff.{old,new}Moved' color or\n \t'color.diff.{old,new}MovedAlternative'. The change between\n \tthe two colors indicates that a new block was detected.\n dimmed_zebra::\ndiff --git a/diff.c b/diff.c\nindex d1bae900cdc..95c51c0b7df 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -271,6 +271,8 @@ static int parse_color_moved(const char *arg)\n \t\treturn COLOR_MOVED_NO;\n \telse if (!strcmp(arg, \"plain\"))\n \t\treturn COLOR_MOVED_PLAIN;\n+\telse if (!strcmp(arg, \"blocks\"))\n+\t\treturn COLOR_MOVED_BLOCKS;\n \telse if (!strcmp(arg, \"zebra\"))\n \t\treturn COLOR_MOVED_ZEBRA;\n \telse if (!strcmp(arg, \"default\"))\n@@ -278,7 +280,7 @@ static int parse_color_moved(const char *arg)\n \telse if (!strcmp(arg, \"dimmed_zebra\"))\n \t\treturn COLOR_MOVED_ZEBRA_DIM;\n \telse\n-\t\treturn error(_(\"color moved setting must be one of 'no', 'default', 'zebra', 'dimmed_zebra', 'plain'\"));\n+\t\treturn error(_(\"color moved setting must be one of 'no', 'default', 'blocks', 'zebra', 'dimmed_zebra', 'plain'\"));\n }\n \n int git_diff_ui_config(const char *var, const char *value, void *cb)\n@@ -903,7 +905,7 @@ static void mark_color_as_moved(struct diff_options *o,\n \n \t\tblock_length++;\n \n-\t\tif (flipped_block)\n+\t\tif (flipped_block && o->color_moved != COLOR_MOVED_BLOCKS)\n \t\t\tl->flags |= DIFF_SYMBOL_MOVED_LINE_ALT;\n \t}\n \tadjust_last_block(o, n, block_length);\ndiff --git a/diff.h b/diff.h\nindex d29560f822c..7bd4f182c33 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -208,8 +208,9 @@ struct diff_options {\n \tenum {\n \t\tCOLOR_MOVED_NO = 0,\n \t\tCOLOR_MOVED_PLAIN = 1,\n-\t\tCOLOR_MOVED_ZEBRA = 2,\n-\t\tCOLOR_MOVED_ZEBRA_DIM = 3,\n+\t\tCOLOR_MOVED_BLOCKS = 2,\n+\t\tCOLOR_MOVED_ZEBRA = 3,\n+\t\tCOLOR_MOVED_ZEBRA_DIM = 4,\n \t} color_moved;\n \t#define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA\n \t#define COLOR_MOVED_MIN_ALNUM_COUNT 20\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 17df491a3ab..45091abb192 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -1223,7 +1223,7 @@ test_expect_success 'plain moved code, inside file' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '\n+test_expect_success 'detect blocks of moved code' '\n \tgit reset --hard &&\n \tcat <<-\\EOF >lines.txt &&\n \t\tlong line 1\n@@ -1271,6 +1271,52 @@ test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '\n \ttest_config color.diff.newMovedDimmed \"normal cyan\" &&\n \ttest_config color.diff.oldMovedAlternativeDimmed \"normal blue\" &&\n \ttest_config color.diff.newMovedAlternativeDimmed \"normal yellow\" &&\n+\n+\tgit diff HEAD --no-renames --color-moved=blocks --color |\n+\t\tgrep -v \"index\" |\n+\t\ttest_decode_color >actual &&\n+\tcat <<-\\EOF >expected &&\n+\t<BOLD>diff --git a/lines.txt b/lines.txt<RESET>\n+\t<BOLD>--- a/lines.txt<RESET>\n+\t<BOLD>+++ b/lines.txt<RESET>\n+\t<CYAN>@@ -1,16 +1,16 @@<RESET>\n+\t<MAGENTA>-long line 1<RESET>\n+\t<MAGENTA>-long line 2<RESET>\n+\t<MAGENTA>-long line 3<RESET>\n+\t line 4<RESET>\n+\t line 5<RESET>\n+\t line 6<RESET>\n+\t line 7<RESET>\n+\t line 8<RESET>\n+\t line 9<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 1<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 2<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 3<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 14<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 15<RESET>\n+\t<CYAN>+<RESET><CYAN>long line 16<RESET>\n+\t line 10<RESET>\n+\t line 11<RESET>\n+\t line 12<RESET>\n+\t line 13<RESET>\n+\t<MAGENTA>-long line 14<RESET>\n+\t<MAGENTA>-long line 15<RESET>\n+\t<MAGENTA>-long line 16<RESET>\n+\tEOF\n+\ttest_cmp expected actual\n+\n+'\n+\n+test_expect_success 'detect permutations inside moved code -- dimmed_zebra' '\n+\t# reuse setup from test before!\n+\ttest_config color.diff.oldMoved \"magenta\" &&\n+\ttest_config color.diff.newMoved \"cyan\" &&\n+\ttest_config color.diff.oldMovedAlternative \"blue\" &&\n+\ttest_config color.diff.newMovedAlternative \"yellow\" &&\n+\ttest_config color.diff.oldMovedDimmed \"normal magenta\" &&\n+\ttest_config color.diff.newMovedDimmed \"normal cyan\" &&\n+\ttest_config color.diff.oldMovedAlternativeDimmed \"normal blue\" &&\n+\ttest_config color.diff.newMovedAlternativeDimmed \"normal yellow\" &&\n \tgit diff HEAD --no-renames --color-moved=dimmed_zebra --color |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347927","messageId":"20180517194653.48928-8-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 7/8] diff.c: add --color-moved-ignore-space-delta option","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:52Z","receivedAt":"2018-05-17T19:47:20Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"This marks moved code still as blocks when their indentation level\nchanges uniformly.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n Documentation/diff-options.txt |  4 ++\n diff.c                         | 83 +++++++++++++++++++++++++++++++---\n diff.h                         |  2 +\n t/t4015-diff-whitespace.sh     | 54 ++++++++++++++++++++++\n 4 files changed, 137 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 7b2527b9a19..facdbc8f95f 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -304,6 +304,10 @@ dimmed_zebra::\n \tIgnore whitespace when comparing lines when performing the move\n \tdetection for --color-moved.  This ignores differences even if\n \tone line has whitespace where the other line has none.\n+--color-moved-[no-]ignore-space-prefix-delta::\n+\tIgnores whitespace when comparing lines when performing the move\n+\tdetection for --color-moved. This ignores uniform differences\n+\tof white space at the beginning lines in moved blocks.\n \n --word-diff[=<mode>]::\n \tShow a word diff, using the <mode> to delimit changed words.\ndiff --git a/diff.c b/diff.c\nindex b5819dd538f..1227a4d2a83 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -709,6 +709,31 @@ struct moved_entry {\n \tstruct moved_entry *next_line;\n };\n \n+struct ws_delta {\n+\tchar *string; /* The prefix delta, which is the same in the block */\n+\tint direction; /* adding or removing the line? */\n+\tint missmatch; /* in the remainder */\n+};\n+#define WS_DELTA_INIT { NULL, 0, 0 }\n+\n+static void compute_ws_delta(const struct emitted_diff_symbol *a,\n+\t\t\t     const struct emitted_diff_symbol *b,\n+\t\t\t     struct ws_delta *out)\n+{\n+\tconst struct emitted_diff_symbol *longer =  a->len > b->len ? a : b;\n+\tconst struct emitted_diff_symbol *shorter = a->len > b->len ? b : a;\n+\tint d = longer->len - shorter->len;\n+\n+\tout->missmatch = !memcmp(longer->line + d, shorter->line, shorter->len);\n+\tout->string = xmemdupz(longer->line, d);\n+\tout->direction = (a == longer);\n+}\n+\n+static int compare_ws_delta(const struct ws_delta *a, const struct ws_delta *b)\n+{\n+\treturn a->direction == b->direction && !strcmp(a->string, b->string);\n+}\n+\n static int moved_entry_cmp(const void *hashmap_cmp_fn_data,\n \t\t\t   const void *entry,\n \t\t\t   const void *entry_or_key,\n@@ -720,6 +745,15 @@ static int moved_entry_cmp(const void *hashmap_cmp_fn_data,\n \tunsigned flags = diffopt->color_moved_ws_handling\n \t\t\t & XDF_WHITESPACE_FLAGS;\n \n+\tif (diffopt->color_moved_ws_handling & COLOR_MOVED_DELTA_WHITESPACES)\n+\t\t/*\n+\t\t * As there is not specific white space config given,\n+\t\t * we'd need to check for a new block, so ignore all\n+\t\t * white space. The setup of the white space\n+\t\t * configuration for the next block is done else where\n+\t\t */\n+\t\tflags |= XDF_IGNORE_WHITESPACE;\n+\n \treturn !xdiff_compare_lines(a->es->line, a->es->len,\n \t\t\t\t    b->es->line, b->es->len,\n \t\t\t\t    flags);\n@@ -772,7 +806,8 @@ static void add_lines_to_move_detection(struct diff_options *o,\n }\n \n static int shrink_potential_moved_blocks(struct moved_entry **pmb,\n-\t\t\t\t\t int pmb_nr)\n+\t\t\t\t\t int pmb_nr,\n+\t\t\t\t\t struct ws_delta **wsd)\n {\n \tint lp, rp;\n \n@@ -788,6 +823,10 @@ static int shrink_potential_moved_blocks(struct moved_entry **pmb,\n \n \t\tif (lp < pmb_nr && rp > -1 && lp < rp) {\n \t\t\tpmb[lp] = pmb[rp];\n+\t\t\tif (*wsd) {\n+\t\t\t\tfree((*wsd)[lp].string);\n+\t\t\t\t(*wsd)[lp] = (*wsd)[rp];\n+\t\t\t}\n \t\t\tpmb[rp] = NULL;\n \t\t\trp--;\n \t\t\tlp++;\n@@ -837,8 +876,11 @@ static void mark_color_as_moved(struct diff_options *o,\n {\n \tstruct moved_entry **pmb = NULL; /* potentially moved blocks */\n \tint pmb_nr = 0, pmb_alloc = 0;\n-\tint n, flipped_block = 1, block_length = 0;\n \n+\tstruct ws_delta *wsd = NULL; /* white space deltas between pmb */\n+\tint wsd_alloc = 0;\n+\n+\tint n, flipped_block = 1, block_length = 0;\n \n \tfor (n = 0; n < o->emitted_symbols->nr; n++) {\n \t\tstruct hashmap *hm = NULL;\n@@ -881,14 +923,31 @@ static void mark_color_as_moved(struct diff_options *o,\n \t\t\tstruct moved_entry *p = pmb[i];\n \t\t\tstruct moved_entry *pnext = (p && p->next_line) ?\n \t\t\t\t\tp->next_line : NULL;\n-\t\t\tif (pnext && !hm->cmpfn(o, pnext, match, NULL)) {\n-\t\t\t\tpmb[i] = p->next_line;\n+\n+\t\t\tif (o->color_moved_ws_handling & COLOR_MOVED_DELTA_WHITESPACES) {\n+\t\t\t\tstruct ws_delta out = WS_DELTA_INIT;\n+\n+\t\t\t\tif (pnext)\n+\t\t\t\t\tcompute_ws_delta(l, pnext->es, &out);\n+\t\t\t\tif (pnext &&\n+\t\t\t\t    !hm->cmpfn(o, pnext, match, NULL) &&\n+\t\t\t\t    compare_ws_delta(&out, &wsd[i])) {\n+\t\t\t\t\tpmb[i] = p->next_line;\n+\t\t\t\t\t/* wsd[i] is the same */\n+\t\t\t\t} else {\n+\t\t\t\t\tpmb[i] = NULL;\n+\t\t\t\t}\n+\t\t\t\tfree(out.string);\n \t\t\t} else {\n-\t\t\t\tpmb[i] = NULL;\n+\t\t\t\tif (pnext && !hm->cmpfn(o, pnext, match, NULL)) {\n+\t\t\t\t\tpmb[i] = p->next_line;\n+\t\t\t\t} else {\n+\t\t\t\t\tpmb[i] = NULL;\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \n-\t\tpmb_nr = shrink_potential_moved_blocks(pmb, pmb_nr);\n+\t\tpmb_nr = shrink_potential_moved_blocks(pmb, pmb_nr, &wsd);\n \n \t\tif (pmb_nr == 0) {\n \t\t\t/*\n@@ -897,6 +956,10 @@ static void mark_color_as_moved(struct diff_options *o,\n \t\t\t */\n \t\t\tfor (; match; match = hashmap_get_next(hm, match)) {\n \t\t\t\tALLOC_GROW(pmb, pmb_nr + 1, pmb_alloc);\n+\t\t\t\tif (o->color_moved_ws_handling & COLOR_MOVED_DELTA_WHITESPACES) {\n+\t\t\t\t\tALLOC_GROW(wsd, pmb_nr + 1, wsd_alloc);\n+\t\t\t\t\tcompute_ws_delta(l, match->es, &wsd[pmb_nr]);\n+\t\t\t\t}\n \t\t\t\tpmb[pmb_nr++] = match;\n \t\t\t}\n \n@@ -914,6 +977,7 @@ static void mark_color_as_moved(struct diff_options *o,\n \tadjust_last_block(o, n, block_length);\n \n \tfree(pmb);\n+\tfree(wsd);\n }\n \n #define DIFF_SYMBOL_MOVED_LINE_ZEBRA_MASK \\\n@@ -4647,12 +4711,16 @@ int diff_opt_parse(struct diff_options *options,\n \t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE_CHANGE;\n \telse if (!strcmp(arg, \"--color-moved-no-ignore-space-at-eol\"))\n \t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE_AT_EOL;\n+\telse if (!strcmp(arg, \"--color-moved-no-ignore-space-prefix-delta\"))\n+\t\toptions->color_moved_ws_handling &= ~COLOR_MOVED_DELTA_WHITESPACES;\n \telse if (!strcmp(arg, \"--color-moved-ignore-all-space\"))\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE;\n \telse if (!strcmp(arg, \"--color-moved-ignore-space-change\"))\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_CHANGE;\n \telse if (!strcmp(arg, \"--color-moved-ignore-space-at-eol\"))\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_AT_EOL;\n+\telse if (!strcmp(arg, \"--color-moved-ignore-space-prefix-delta\"))\n+\t\toptions->color_moved_ws_handling |= COLOR_MOVED_DELTA_WHITESPACES;\n \telse if (!strcmp(arg, \"--indent-heuristic\"))\n \t\tDIFF_XDL_SET(options, INDENT_HEURISTIC);\n \telse if (!strcmp(arg, \"--no-indent-heuristic\"))\n@@ -5558,6 +5626,9 @@ static void diff_flush_patch_all_file_pairs(struct diff_options *o)\n \t\t\thashmap_init(&del_lines, moved_entry_cmp, o, 0);\n \t\t\thashmap_init(&add_lines, moved_entry_cmp, o, 0);\n \n+\t\t\tif (o->color_moved_ws_handling & COLOR_MOVED_DELTA_WHITESPACES)\n+\t\t\t\to->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE;\n+\n \t\t\tadd_lines_to_move_detection(o, &add_lines, &del_lines);\n \t\t\tmark_color_as_moved(o, &add_lines, &del_lines);\n \t\t\tif (o->color_moved == COLOR_MOVED_ZEBRA_DIM)\ndiff --git a/diff.h b/diff.h\nindex de5dc680051..b00ea76c083 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -214,6 +214,8 @@ struct diff_options {\n \t} color_moved;\n \t#define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA\n \t#define COLOR_MOVED_MIN_ALNUM_COUNT 20\n+\t/* XDF_WHITESPACE_FLAGS regarding block detection are set at 2, 3, 4 */\n+\t#define COLOR_MOVED_DELTA_WHITESPACES\t(1 << 22)\n \tint color_moved_ws_handling;\n };\n \ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 751fc478dde..37ff528822f 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -1847,4 +1847,58 @@ test_expect_success 'only move detection ignores white spaces' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'compare whitespace delta across moved blocks' '\n+\n+\tgit reset --hard &&\n+\tq_to_tab <<-\\EOF >text.txt &&\n+\tQIndented\n+\tQText across\n+\tQthree lines\n+\tQBut! <- this stands out\n+\tQthis one\n+\tQQline did\n+\tQnot adjust\n+\tEOF\n+\n+\tgit add text.txt &&\n+\tgit commit -m \"add text.txt\" &&\n+\n+\tq_to_tab <<-\\EOF >text.txt &&\n+\tQQIndented\n+\tQQText across\n+\tQQthree lines\n+\tQQQBut! <- this stands out\n+\tthis one\n+\tQline did\n+\tnot adjust\n+\tEOF\n+\n+\tgit diff --color --color-moved --color-moved-ignore-space-prefix-delta |\n+\t\tgrep -v \"index\" |\n+\t\ttest_decode_color >actual &&\n+\n+\tq_to_tab <<-\\EOF >expected &&\n+\t\t<BOLD>diff --git a/text.txt b/text.txt<RESET>\n+\t\t<BOLD>--- a/text.txt<RESET>\n+\t\t<BOLD>+++ b/text.txt<RESET>\n+\t\t<CYAN>@@ -1,7 +1,7 @@<RESET>\n+\t\t<BOLD;MAGENTA>-QIndented<RESET>\n+\t\t<BOLD;MAGENTA>-QText across<RESET>\n+\t\t<BOLD;MAGENTA>-Qthree lines<RESET>\n+\t\t<RED>-QBut! <- this stands out<RESET>\n+\t\t<BOLD;MAGENTA>-Qthis one<RESET>\n+\t\t<BOLD;MAGENTA>-QQline did<RESET>\n+\t\t<BOLD;MAGENTA>-Qnot adjust<RESET>\n+\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>Indented<RESET>\n+\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>Text across<RESET>\n+\t\t<BOLD;YELLOW>+<RESET>QQ<BOLD;YELLOW>three lines<RESET>\n+\t\t<GREEN>+<RESET>QQQ<GREEN>But! <- this stands out<RESET>\n+\t\t<BOLD;YELLOW>+<RESET><BOLD;YELLOW>this one<RESET>\n+\t\t<BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>line did<RESET>\n+\t\t<BOLD;YELLOW>+<RESET><BOLD;YELLOW>not adjust<RESET>\n+\tEOF\n+\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347928","messageId":"20180517194653.48928-9-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 8/8] diff: color-moved white space handling options imply color-moved","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:53Z","receivedAt":"2018-05-17T19:47:21Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"When giving options how move coloring should treat white spaces, the user\nexpects that move coloring is actually active. If it is not active, we\ncan just take the default mode.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n diff.c                     | 18 +++++++++++++-----\n t/t4015-diff-whitespace.sh |  9 +++++++--\n 2 files changed, 20 insertions(+), 7 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 1227a4d2a83..a10184e576e 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4713,15 +4713,23 @@ int diff_opt_parse(struct diff_options *options,\n \t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE_AT_EOL;\n \telse if (!strcmp(arg, \"--color-moved-no-ignore-space-prefix-delta\"))\n \t\toptions->color_moved_ws_handling &= ~COLOR_MOVED_DELTA_WHITESPACES;\n-\telse if (!strcmp(arg, \"--color-moved-ignore-all-space\"))\n+\telse if (!strcmp(arg, \"--color-moved-ignore-all-space\")) {\n+\t\tif (options->color_moved == COLOR_MOVED_NO)\n+\t\t\toptions->color_moved = COLOR_MOVED_DEFAULT;\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE;\n-\telse if (!strcmp(arg, \"--color-moved-ignore-space-change\"))\n+\t} else if (!strcmp(arg, \"--color-moved-ignore-space-change\")) {\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_CHANGE;\n-\telse if (!strcmp(arg, \"--color-moved-ignore-space-at-eol\"))\n+\t\tif (options->color_moved == COLOR_MOVED_NO)\n+\t\t\toptions->color_moved = COLOR_MOVED_DEFAULT;\n+\t} else if (!strcmp(arg, \"--color-moved-ignore-space-at-eol\")) {\n \t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_AT_EOL;\n-\telse if (!strcmp(arg, \"--color-moved-ignore-space-prefix-delta\"))\n+\t\tif (options->color_moved == COLOR_MOVED_NO)\n+\t\t\toptions->color_moved = COLOR_MOVED_DEFAULT;\n+\t} else if (!strcmp(arg, \"--color-moved-ignore-space-prefix-delta\")) {\n \t\toptions->color_moved_ws_handling |= COLOR_MOVED_DELTA_WHITESPACES;\n-\telse if (!strcmp(arg, \"--indent-heuristic\"))\n+\t\tif (options->color_moved == COLOR_MOVED_NO)\n+\t\t\toptions->color_moved = COLOR_MOVED_DEFAULT;\n+\t} else if (!strcmp(arg, \"--indent-heuristic\"))\n \t\tDIFF_XDL_SET(options, INDENT_HEURISTIC);\n \telse if (!strcmp(arg, \"--no-indent-heuristic\"))\n \t\tDIFF_XDL_CLR(options, INDENT_HEURISTIC);\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 37ff528822f..e1ab08d7bb4 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -1875,7 +1875,11 @@ test_expect_success 'compare whitespace delta across moved blocks' '\n \n \tgit diff --color --color-moved --color-moved-ignore-space-prefix-delta |\n \t\tgrep -v \"index\" |\n-\t\ttest_decode_color >actual &&\n+\t\ttest_decode_color >actual1 &&\n+\n+\tgit diff --color --color-moved-ignore-space-prefix-delta |\n+\t\tgrep -v \"index\" |\n+\t\ttest_decode_color >actual2 &&\n \n \tq_to_tab <<-\\EOF >expected &&\n \t\t<BOLD>diff --git a/text.txt b/text.txt<RESET>\n@@ -1898,7 +1902,8 @@ test_expect_success 'compare whitespace delta across moved blocks' '\n \t\t<BOLD;YELLOW>+<RESET><BOLD;YELLOW>not adjust<RESET>\n \tEOF\n \n-\ttest_cmp expected actual\n+\ttest_cmp expected actual1 &&\n+\ttest_cmp expected actual2\n '\n \n test_done\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347929","messageId":"20180517194653.48928-4-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 3/8] diff.c: do not pass diff options as keydata to hashmap","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:48Z","receivedAt":"2018-05-17T19:47:28Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"When we initialize the hashmap, we give it a pointer to the\ndiff_options, which it then passes along to each call of the\nhashmap_cmp_fn function. There's no need to pass it a second time as\nthe \"keydata\" parameter, and our comparison functions never look at\nkeydata.\n\nThis was a mistake left over from an earlier round of 2e2d5ac184\n(diff.c: color moved lines differently, 2017-06-30), before hashmap\nlearned to pass the data pointer for us.\n\nExplanation-by: Jeff King <peff@peff.net>\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n diff.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 1289df4b1f9..ce7bedc1b92 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -842,13 +842,13 @@ static void mark_color_as_moved(struct diff_options *o,\n \t\tcase DIFF_SYMBOL_PLUS:\n \t\t\thm = del_lines;\n \t\t\tkey = prepare_entry(o, n);\n-\t\t\tmatch = hashmap_get(hm, key, o);\n+\t\t\tmatch = hashmap_get(hm, key, NULL);\n \t\t\tfree(key);\n \t\t\tbreak;\n \t\tcase DIFF_SYMBOL_MINUS:\n \t\t\thm = add_lines;\n \t\t\tkey = prepare_entry(o, n);\n-\t\t\tmatch = hashmap_get(hm, key, o);\n+\t\t\tmatch = hashmap_get(hm, key, NULL);\n \t\t\tfree(key);\n \t\t\tbreak;\n \t\tdefault:\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347930","messageId":"20180517194653.48928-7-sbeller@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"[PATCH 6/8] diff.c: decouple white space treatment from move detection algorithm","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T19:46:51Z","receivedAt":"2018-05-17T19:47:29Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In the original implementation of the move detection logic the choice for\nignoring white space changes is the same for the move detection as it is\nfor the regular diff.  Some cases came up where different treatment would\nhave been nice.\n\nAllow the user to specify that whitespace should be ignored differently\nduring detection of moved lines than during generation of added and removed\nlines. This is done by providing analogs to the --ignore-space-at-eol,\n-b, and -w options (namely,\n  --color-moved-[no-]ignore-space-at-eol\n  --color-moved-[no-]ignore-space-change\n  --color-moved-[no-]ignore-all-space) that affect only the color of the\noutput, and making the existing --ignore-space-at-eol, -b, and -w options\nno longer affect the color of the output.\n\nAs we change the default, we'll adjust the tests.\n\nFor now we do not infer any options to treat whitespaces in the move\ndetection from the generic white space options given to diff.\nThis can be tuned later to reasonable default.\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/diff-options.txt | 13 +++++\n diff.c                         | 19 ++++++-\n diff.h                         |  1 +\n t/t4015-diff-whitespace.sh     | 90 +++++++++++++++++++++++++++++++---\n 4 files changed, 114 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex bb9f1b7cd82..7b2527b9a19 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -292,6 +292,19 @@ dimmed_zebra::\n \tblocks are considered interesting, the rest is uninteresting.\n --\n \n+--color-moved-[no-]ignore-space-at-eol::\n+\tIgnore changes in whitespace at EOL when performing the move\n+\tdetection for --color-moved.\n+--color-moved-[no-]ignore-space-change::\n+\tIgnore changes in amount of whitespace when performing the move\n+\tdetection for --color-moved.  This ignores whitespace\n+\tat line end, and considers all other sequences of one or\n+\tmore whitespace characters to be equivalent.\n+--color-moved-[no-]ignore-all-space::\n+\tIgnore whitespace when comparing lines when performing the move\n+\tdetection for --color-moved.  This ignores differences even if\n+\tone line has whitespace where the other line has none.\n+\n --word-diff[=<mode>]::\n \tShow a word diff, using the <mode> to delimit changed words.\n \tBy default, words are delimited by whitespace; see\ndiff --git a/diff.c b/diff.c\nindex 95c51c0b7df..b5819dd538f 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -717,10 +717,12 @@ static int moved_entry_cmp(const void *hashmap_cmp_fn_data,\n \tconst struct diff_options *diffopt = hashmap_cmp_fn_data;\n \tconst struct moved_entry *a = entry;\n \tconst struct moved_entry *b = entry_or_key;\n+\tunsigned flags = diffopt->color_moved_ws_handling\n+\t\t\t & XDF_WHITESPACE_FLAGS;\n \n \treturn !xdiff_compare_lines(a->es->line, a->es->len,\n \t\t\t\t    b->es->line, b->es->len,\n-\t\t\t\t    diffopt->xdl_opts);\n+\t\t\t\t    flags);\n }\n \n static struct moved_entry *prepare_entry(struct diff_options *o,\n@@ -728,8 +730,9 @@ static struct moved_entry *prepare_entry(struct diff_options *o,\n {\n \tstruct moved_entry *ret = xmalloc(sizeof(*ret));\n \tstruct emitted_diff_symbol *l = &o->emitted_symbols->buf[line_no];\n+\tunsigned flags = o->color_moved_ws_handling & XDF_WHITESPACE_FLAGS;\n \n-\tret->ent.hash = xdiff_hash_string(l->line, l->len, o->xdl_opts);\n+\tret->ent.hash = xdiff_hash_string(l->line, l->len, flags);\n \tret->es = l;\n \tret->next_line = NULL;\n \n@@ -4638,6 +4641,18 @@ int diff_opt_parse(struct diff_options *options,\n \t\tDIFF_XDL_SET(options, IGNORE_CR_AT_EOL);\n \telse if (!strcmp(arg, \"--ignore-blank-lines\"))\n \t\tDIFF_XDL_SET(options, IGNORE_BLANK_LINES);\n+\telse if (!strcmp(arg, \"--color-moved-no-ignore-all-space\"))\n+\t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE;\n+\telse if (!strcmp(arg, \"--color-moved-no-ignore-space-change\"))\n+\t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE_CHANGE;\n+\telse if (!strcmp(arg, \"--color-moved-no-ignore-space-at-eol\"))\n+\t\toptions->color_moved_ws_handling &= ~XDF_IGNORE_WHITESPACE_AT_EOL;\n+\telse if (!strcmp(arg, \"--color-moved-ignore-all-space\"))\n+\t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE;\n+\telse if (!strcmp(arg, \"--color-moved-ignore-space-change\"))\n+\t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_CHANGE;\n+\telse if (!strcmp(arg, \"--color-moved-ignore-space-at-eol\"))\n+\t\toptions->color_moved_ws_handling |= XDF_IGNORE_WHITESPACE_AT_EOL;\n \telse if (!strcmp(arg, \"--indent-heuristic\"))\n \t\tDIFF_XDL_SET(options, INDENT_HEURISTIC);\n \telse if (!strcmp(arg, \"--no-indent-heuristic\"))\ndiff --git a/diff.h b/diff.h\nindex 7bd4f182c33..de5dc680051 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -214,6 +214,7 @@ struct diff_options {\n \t} color_moved;\n \t#define COLOR_MOVED_DEFAULT COLOR_MOVED_ZEBRA\n \t#define COLOR_MOVED_MIN_ALNUM_COUNT 20\n+\tint color_moved_ws_handling;\n };\n \n void diff_emit_submodule_del(struct diff_options *o, const char *line);\ndiff --git a/t/t4015-diff-whitespace.sh b/t/t4015-diff-whitespace.sh\nindex 45091abb192..751fc478dde 100755\n--- a/t/t4015-diff-whitespace.sh\n+++ b/t/t4015-diff-whitespace.sh\n@@ -1441,7 +1441,10 @@ test_expect_success 'move detection ignoring whitespace ' '\n \tline 4\n \tline 5\n \tEOF\n-\tgit diff HEAD --no-renames --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-no-ignore-space-at-eol |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1465,7 +1468,10 @@ test_expect_success 'move detection ignoring whitespace ' '\n \tEOF\n \ttest_cmp expected actual &&\n \n-\tgit diff HEAD --no-renames -w --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-no-ignore-space-at-eol |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1505,7 +1511,10 @@ test_expect_success 'move detection ignoring whitespace changes' '\n \tline 5\n \tEOF\n \n-\tgit diff HEAD --no-renames --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-no-ignore-space-at-eol |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1529,7 +1538,10 @@ test_expect_success 'move detection ignoring whitespace changes' '\n \tEOF\n \ttest_cmp expected actual &&\n \n-\tgit diff HEAD --no-renames -b --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-at-eol \\\n+\t\t--color-moved-ignore-space-change |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1572,7 +1584,10 @@ test_expect_success 'move detection ignoring whitespace at eol' '\n \t# avoid cluttering the output with complaints about our eol whitespace\n \ttest_config core.whitespace -blank-at-eol &&\n \n-\tgit diff HEAD --no-renames --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-no-ignore-space-at-eol |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1596,7 +1611,10 @@ test_expect_success 'move detection ignoring whitespace at eol' '\n \tEOF\n \ttest_cmp expected actual &&\n \n-\tgit diff HEAD --no-renames --ignore-space-at-eol --color-moved --color |\n+\tgit diff HEAD --no-renames --color-moved --color \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-ignore-space-at-eol |\n \t\tgrep -v \"index\" |\n \t\ttest_decode_color >actual &&\n \tcat <<-\\EOF >expected &&\n@@ -1768,7 +1786,65 @@ test_expect_success 'move detection with submodules' '\n \n \t# nor did we mess with it another way\n \tgit diff --submodule=diff --color | test_decode_color >expect &&\n-\ttest_cmp expect decoded_actual\n+\ttest_cmp expect decoded_actual &&\n+\trm -rf bananas &&\n+\tgit submodule deinit bananas\n+'\n+\n+test_expect_success 'only move detection ignores white spaces' '\n+\tgit reset --hard &&\n+\tq_to_tab <<-\\EOF >text.txt &&\n+\t\ta long line to exceed per-line minimum\n+\t\tanother long line to exceed per-line minimum\n+\t\toriginal file\n+\tEOF\n+\tgit add text.txt &&\n+\tgit commit -m \"add text\" &&\n+\tq_to_tab <<-\\EOF >text.txt &&\n+\t\tQa long line to exceed per-line minimum\n+\t\tQanother long line to exceed per-line minimum\n+\t\tnew file\n+\tEOF\n+\n+\t# Make sure we get a different diff using -w\n+\tgit diff --color --color-moved -w \\\n+\t\t--color-moved-no-ignore-all-space \\\n+\t\t--color-moved-no-ignore-space-change \\\n+\t\t--color-moved-no-ignore-space-at-eol |\n+\t\tgrep -v \"index\" |\n+\t\ttest_decode_color >actual &&\n+\tq_to_tab <<-\\EOF >expected &&\n+\t<BOLD>diff --git a/text.txt b/text.txt<RESET>\n+\t<BOLD>--- a/text.txt<RESET>\n+\t<BOLD>+++ b/text.txt<RESET>\n+\t<CYAN>@@ -1,3 +1,3 @@<RESET>\n+\t Qa long line to exceed per-line minimum<RESET>\n+\t Qanother long line to exceed per-line minimum<RESET>\n+\t<RED>-original file<RESET>\n+\t<GREEN>+<RESET><GREEN>new file<RESET>\n+\tEOF\n+\ttest_cmp expected actual &&\n+\n+\t# And now ignoring white space only in the move detection\n+\tgit diff --color --color-moved \\\n+\t\t--color-moved-ignore-all-space \\\n+\t\t--color-moved-ignore-space-change \\\n+\t\t--color-moved-ignore-space-at-eol |\n+\t\tgrep -v \"index\" |\n+\t\ttest_decode_color >actual &&\n+\tq_to_tab <<-\\EOF >expected &&\n+\t<BOLD>diff --git a/text.txt b/text.txt<RESET>\n+\t<BOLD>--- a/text.txt<RESET>\n+\t<BOLD>+++ b/text.txt<RESET>\n+\t<CYAN>@@ -1,3 +1,3 @@<RESET>\n+\t<BOLD;MAGENTA>-a long line to exceed per-line minimum<RESET>\n+\t<BOLD;MAGENTA>-another long line to exceed per-line minimum<RESET>\n+\t<RED>-original file<RESET>\n+\t<BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>a long line to exceed per-line minimum<RESET>\n+\t<BOLD;YELLOW>+<RESET>Q<BOLD;YELLOW>another long line to exceed per-line minimum<RESET>\n+\t<GREEN>+<RESET><GREEN>new file<RESET>\n+\tEOF\n+\ttest_cmp expected actual\n '\n \n test_done\n-- \n2.17.0.582.gccdcbd54c44.dirty\n\n"},{"id":"347938","messageId":"xmqqbmdd6hb5.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"CAGZ79kY1DOgrbkgUWHb+5KSBjrupHod0n8SU6M+xMnBGjMTmZQ@mail.gmail.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-17T22:36:14Z","receivedAt":"2018-05-17T22:36:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n>> * sb/object-store-replace (2018-05-10) 2 commits\n>>   (merged to 'next' on 2018-05-16 at 41bbedcc81)\n>>  + replace-object.c: remove the_repository from prepare_replace_object\n>>  + object.c: free replace map in raw_object_store_clear\n>>\n>>  Hotfix.\n>>\n>>  Will merge to 'master'.\n>\n> Please do not.\n> (Or do, but then be prepared for another hotfix.)\n>\n> The commit sb/object-store-replace^ needs more free'ing and shall be\n> replaced with\n\nPlease do not replace what already hit 'next'.\n\n> https://public-inbox.org/git/20180510195849.28023-4-sbeller@google.com/\n> I'll resend shortly.\n>\n>>\n>> * sb/submodule-merge-in-merge-recursive (2018-05-16) 3 commits\n>>  - merge-recursive: give notice when submodule commit gets fast-forwarded\n>>  - merge-recursive: i18n submodule merge output and respect verbosity\n>>  - submodule.c: move submodule merging to merge-recursive.c\n>>\n>>  By code restructuring of submodule merge in merge-recursive,\n>>  informational messages from the codepath are now given using the\n>>  same mechanism as other output, and honor the merge.verbosity\n>>  configuration.  The code also learned to give a few new messages\n>>  when a submodule three-way merge resolves cleanly when one side\n>>  records a descendant of the commit chosen by the other side.\n>>\n>>  Will merge to 'next'.\n>\n> Merging would be ok, but I would rather not.\n> A resend will be only for cosmetic effect, as I messed up the last commit\n>\n> So, please hold in pu.\n>\n>> * sb/diff-color-move-more (2018-04-25) 7 commits\n>>  - diff.c: add --color-moved-ignore-space-delta option\n>>  - diff.c: decouple white space treatment from move detection algorithm\n>>  - diff.c: add a blocks mode for moved code detection\n>>  - diff.c: adjust hash function signature to match hashmap expectation\n>>  - diff.c: do not pass diff options as keydata to hashmap\n>>  - xdiff/xdiffi.c: remove unneeded function declarations\n>>  - xdiff/xdiff.h: remove unused flags\n>>\n>>  \"git diff --color-moved\" feature has further been tweaked.\n>>\n>>  Will merge to 'next'.\n>\n> I did not get around to fix it up, there are still review\n> comments outstanding. (The test is broken in the last commit.)\n>\n> Please hold in pu;\n>\n> Thanks,\n> Stefan\n"},{"id":"347939","messageId":"CAGZ79kbUXz5fgvSF20UZQbhByq-UcZHR81d4UFAcvASqQb3A-Q@mail.gmail.com","threadId":"48510","inReplyTo":"xmqqbmdd6hb5.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T22:39:36Z","receivedAt":"2018-05-17T22:39:41Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, May 17, 2018 at 3:36 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stefan Beller <sbeller@google.com> writes:\n>\n>>> * sb/object-store-replace (2018-05-10) 2 commits\n>>>   (merged to 'next' on 2018-05-16 at 41bbedcc81)\n>>>  + replace-object.c: remove the_repository from prepare_replace_object\n>>>  + object.c: free replace map in raw_object_store_clear\n>>>\n>>>  Hotfix.\n>>>\n>>>  Will merge to 'master'.\n>>\n>> Please do not.\n>> (Or do, but then be prepared for another hotfix.)\n>>\n>> The commit sb/object-store-replace^ needs more free'ing and shall be\n>> replaced with\n>\n> Please do not replace what already hit 'next'.\n\nI missed that it hit next. Sorry about that. I'll roll a patch on top then.\n"},{"id":"347960","messageId":"20180517155313.6a529d76ab1f6e8f2a05e1a8@google.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"Re: [PATCH 0/8] Reroll of sb/diff-color-move-more","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2018-05-17T22:53:13Z","receivedAt":"2018-05-17T22:53:18Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"On Thu, 17 May 2018 12:46:45 -0700\nStefan Beller <sbeller@google.com> wrote:\n\n> Stefan Beller (8):\n>   xdiff/xdiff.h: remove unused flags\n>   xdiff/xdiffi.c: remove unneeded function declarations\n>   diff.c: do not pass diff options as keydata to hashmap\n>   diff.c: adjust hash function signature to match hashmap expectation\n>   diff.c: add a blocks mode for moved code detection\n>   diff.c: decouple white space treatment from move detection algorithm\n>   diff.c: add --color-moved-ignore-space-delta option\n>   diff: color-moved white space handling options imply color-moved\n\nThe test in patch 7 is indeed fixed, and patch 8 looks good to me.\n\nThere are still some review comments of mine outstanding [1] [2] but if\nwe decide that this series is good enough for now, that's OK.\n\n[1] https://public-inbox.org/git/20180424153513.dc2404cd111c44ac78bd8ed8@google.com/\n[2] https://public-inbox.org/git/20180424171123.7092788b94498908c25eccf0@google.com/\n"},{"id":"347961","messageId":"xmqq7eo16gct.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"xmqqbmdd6hb5.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-17T22:56:50Z","receivedAt":"2018-05-17T22:56:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Stefan Beller <sbeller@google.com> writes:\n>\n>>> * sb/object-store-replace (2018-05-10) 2 commits\n>>>   (merged to 'next' on 2018-05-16 at 41bbedcc81)\n>>>  + replace-object.c: remove the_repository from prepare_replace_object\n>>>  + object.c: free replace map in raw_object_store_clear\n>>>\n>>>  Hotfix.\n>>>\n>>>  Will merge to 'master'.\n>>\n>> Please do not.\n>> (Or do, but then be prepared for another hotfix.)\n>>\n>> The commit sb/object-store-replace^ needs more free'ing and shall be\n>> replaced with\n>\n> Please do not replace what already hit 'next'.\n\nHere is what I made these two into a relative fix on top.\n\n-- >8 --\nFrom: Stefan Beller <sbeller@google.com>\nDate: Thu, 17 May 2018 11:29:57 -0700\nSubject: [PATCH] object.c: clear replace map before freeing it\n\nSigned-off-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n object.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/object.c b/object.c\nindex cdf520084d..97245fdea2 100644\n--- a/object.c\n+++ b/object.c\n@@ -480,6 +480,8 @@ void raw_object_store_clear(struct raw_object_store *o)\n {\n \tFREE_AND_NULL(o->objectdir);\n \tFREE_AND_NULL(o->alternate_db);\n+\n+\toidmap_free(o->replace_map, 1);\n \tFREE_AND_NULL(o->replace_map);\n \n \tfree_alt_odbs(o);\n-- \n2.17.0-582-gccdcbd54c4\n\n"},{"id":"347963","messageId":"CAGZ79kYcA4TbVoPnJOS2Kmr7hfeZs=OnVPkmnepBhNCMysCfBQ@mail.gmail.com","threadId":"48510","inReplyTo":"xmqq7eo16gct.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-17T22:58:07Z","receivedAt":"2018-05-17T22:58:11Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":">> Please do not replace what already hit 'next'.\n>\n> Here is what I made these two into a relative fix on top.\n\nThanks, I was about to prepare the same.\n"},{"id":"347968","messageId":"20180518040006.GA31451@ruderich.org","threadId":"48510","inReplyTo":"20180517194653.48928-7-sbeller@google.com","subject":"Re: [PATCH 6/8] diff.c: decouple white space treatment from move detection algorithm","fromName":"Simon Ruderich","fromEmail":"simon@ruderich.org","sentAt":"2018-05-18T04:00:06Z","receivedAt":"2018-05-18T04:00:11Z","isPatch":true,"sender":{"key":"simon@ruderich.org","avatar":"https://avatars.githubusercontent.com/u/390994?v=4"},"body":"On Thu, May 17, 2018 at 12:46:51PM -0700, Stefan Beller wrote:\n> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n> index bb9f1b7cd82..7b2527b9a19 100644\n> --- a/Documentation/diff-options.txt\n> +++ b/Documentation/diff-options.txt\n> @@ -292,6 +292,19 @@ dimmed_zebra::\n>  \tblocks are considered interesting, the rest is uninteresting.\n>  --\n>\n> +--color-moved-[no-]ignore-space-at-eol::\n> +\tIgnore changes in whitespace at EOL when performing the move\n> +\tdetection for --color-moved.\n> +--color-moved-[no-]ignore-space-change::\n> +\tIgnore changes in amount of whitespace when performing the move\n> +\tdetection for --color-moved.  This ignores whitespace\n> +\tat line end, and considers all other sequences of one or\n> +\tmore whitespace characters to be equivalent.\n> +--color-moved-[no-]ignore-all-space::\n> +\tIgnore whitespace when comparing lines when performing the move\n> +\tdetection for --color-moved.  This ignores differences even if\n> +\tone line has whitespace where the other line has none.\n> +\n>  --word-diff[=<mode>]::\n>  \tShow a word diff, using the <mode> to delimit changed words.\n>  \tBy default, words are delimited by whitespace; see\n\nHello,\n\nI think it would be better to specify the options unabbreviated.\nNot being able to search the man page for\n\"--color-moved-ignore-space-at-eol\" or\n\"--color-moved-no-ignore-space-at-eol\" can be a major pain when\nlooking for documentation. So maybe something like this instead:\n\n> +--color-moved-ignore-space-at-eol::\n> +--color-moved-no-ignore-space-at-eol::\n> +\tIgnore changes in whitespace at EOL when performing the move\n> +\tdetection for --color-moved.\n\nRegards\nSimon\n-- \n+ privacy is necessary\n+ using gnupg http://gnupg.org\n+ public key id: 0x92FEFDB7E44C32F9\n"},{"id":"347996","messageId":"CAGZ79kZ8VCAjxz36LDfKwZ9pvQSQwqkh_gijqxJQ57UG6zYHdQ@mail.gmail.com","threadId":"48510","inReplyTo":"20180518040006.GA31451@ruderich.org","subject":"Re: [PATCH 6/8] diff.c: decouple white space treatment from move detection algorithm","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-18T19:25:14Z","receivedAt":"2018-05-18T19:25:20Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, May 17, 2018 at 9:00 PM, Simon Ruderich <simon@ruderich.org> wrote:\n> On Thu, May 17, 2018 at 12:46:51PM -0700, Stefan Beller wrote:\n>> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n>> index bb9f1b7cd82..7b2527b9a19 100644\n>> --- a/Documentation/diff-options.txt\n>> +++ b/Documentation/diff-options.txt\n>> @@ -292,6 +292,19 @@ dimmed_zebra::\n>>       blocks are considered interesting, the rest is uninteresting.\n>>  --\n>>\n>> +--color-moved-[no-]ignore-space-at-eol::\n>> +     Ignore changes in whitespace at EOL when performing the move\n>> +     detection for --color-moved.\n>> +--color-moved-[no-]ignore-space-change::\n>> +     Ignore changes in amount of whitespace when performing the move\n>> +     detection for --color-moved.  This ignores whitespace\n>> +     at line end, and considers all other sequences of one or\n>> +     more whitespace characters to be equivalent.\n>> +--color-moved-[no-]ignore-all-space::\n>> +     Ignore whitespace when comparing lines when performing the move\n>> +     detection for --color-moved.  This ignores differences even if\n>> +     one line has whitespace where the other line has none.\n>> +\n>>  --word-diff[=<mode>]::\n>>       Show a word diff, using the <mode> to delimit changed words.\n>>       By default, words are delimited by whitespace; see\n>\n> Hello,\n>\n> I think it would be better to specify the options unabbreviated.\n> Not being able to search the man page for\n> \"--color-moved-ignore-space-at-eol\" or\n> \"--color-moved-no-ignore-space-at-eol\" can be a major pain when\n> looking for documentation. So maybe something like this instead:\n>\n>> +--color-moved-ignore-space-at-eol::\n>> +--color-moved-no-ignore-space-at-eol::\n>> +     Ignore changes in whitespace at EOL when performing the move\n>> +     detection for --color-moved.\n\nThat makes sense.\n\nStepping back a bit, looking for similar precedents, we have lots of\n\"[no-]\" strings in our documentation. But that is ok, as we the prefix\nis at the beginning of the option (\"--[no-]foo-bar\"), such that searching\nfor the whole option without the leading dashes (\"foo-bar\") will still find\nthe option.\n\nSo maybe another option would be rename the negative options\nto \"--no-color-moved-ignore-space-at-eol\", such that the documentation\ncould fall back to the old pattern of \"--[no-]long-name\".\n\nInitially I was tempted on not choosing such names, as I viewed all\nthis white space options specific to the color-move feature, such that\na prefix of \"--color-moved\" might be desirable. Turning off one sub-feature\nin that feature would naturally be --feature-no-subfeature instead of\nnegating the whole feature.\n\nI also cannot find a good existing example for subfeatures in features,\nthey would usually come as --feature=<option1, option2>\n\nUndecided,\nStefan\n"},{"id":"347998","messageId":"20180518194317.28043-1-leif.middelschulte@gmail.com","threadId":"48510","inReplyTo":"20180517184008.25445-1-sbeller@google.com","subject":"[PATCH v2 0/1] rebased: inform about auto submodule ff","fromName":"Leif Middelschulte","fromEmail":"leif.middelschulte@gmail.com","sentAt":"2018-05-18T19:43:16Z","receivedAt":"2018-05-18T19:43:29Z","isPatch":true,"sender":{"key":"leif.middelschulte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1136427?v=4"},"body":"From: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n\nThis is a follow-up on Junio C Hamano's comments [0] and Stefan Beller's request\n[1] for a more explainatory/elaborate commit message.\n\n[0] https://public-inbox.org/git/xmqqk1s474vx.fsf@gitster-ct.c.googlers.com/\n[1] https://public-inbox.org/git/20180517184008.25445-1-sbeller@google.com/\n\nLeif Middelschulte (1):\n  Inform about fast-forwarding of submodules during merge\n\n merge-recursive.c | 4 ++++\n 1 file changed, 4 insertions(+)\n\n-- \n2.15.1 (Apple Git-101)\n\n"},{"id":"347999","messageId":"20180518194802.28355-1-leif.middelschulte@gmail.com","threadId":"48510","inReplyTo":"20180517184008.25445-1-sbeller@google.com","subject":"[PATCH v3 0/1] rebased: inform about auto submodule ff","fromName":"Leif Middelschulte","fromEmail":"leif.middelschulte@gmail.com","sentAt":"2018-05-18T19:48:01Z","receivedAt":"2018-05-18T19:48:10Z","isPatch":true,"sender":{"key":"leif.middelschulte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1136427?v=4"},"body":"From: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n\nThis is a follow-up on Junio C Hamano's comments [0] and Stefan Beller's request\n[1] for a more explainatory/elaborate commit message.\n\n[0] https://public-inbox.org/git/xmqqk1s474vx.fsf@gitster-ct.c.googlers.com/\n[1] https://public-inbox.org/git/20180517184008.25445-1-sbeller@google.com/\n\nLeif Middelschulte (1):\n  Inform about fast-forwarding of submodules during merge\n\n merge-recursive.c | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\n-- \n2.15.1 (Apple Git-101)\n\n"},{"id":"348000","messageId":"20180518194802.28355-2-leif.middelschulte@gmail.com","threadId":"48510","inReplyTo":"20180518194802.28355-1-leif.middelschulte@gmail.com","subject":"[PATCH 1/1] Inform about fast-forwarding of submodules during merge","fromName":"Leif Middelschulte","fromEmail":"leif.middelschulte@gmail.com","sentAt":"2018-05-18T19:48:02Z","receivedAt":"2018-05-18T19:48:26Z","isPatch":true,"sender":{"key":"leif.middelschulte@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1136427?v=4"},"body":"From: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n\nSilent fast-forwarding might lead to inconveniences in cases where\nsubmodules are expected to have a certain revision, because 'more recent'\n(therefore fast-forwardable) versions might break behavior/contain regressions.\n\nA use-case is the integration (merge) phase as part of the feature-centric\n'git-flow' workflow [0]. I.e. a feature might be well-tested with a certain\nsubmodule revision, but break because of regressions (or changes in general)\nwithin an updated version of the sourced submodule.\n\nThis change tries to support the integrator by telling her about another possible\nsource of unexpected behavior (differing submodule versions) she might see\nduring integration tests.\n\n[0] http://nvie.com/posts/a-successful-git-branching-model/\n\nSigned-off-by: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n---\n merge-recursive.c | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/merge-recursive.c b/merge-recursive.c\nindex a4b91d17f..e2c99924d 100644\n--- a/merge-recursive.c\n+++ b/merge-recursive.c\n@@ -1093,10 +1093,26 @@ static int merge_submodule(struct merge_options *o,\n \t/* Case #1: a is contained in b or vice versa */\n \tif (in_merge_bases(commit_a, commit_b)) {\n \t\toidcpy(result, b);\n+\t\tif (show(o, 3)) {\n+\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n+\t\t\toutput_commit_title(o, commit_b);\n+\t\t} else if (show(o, 2))\n+\t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(b));\n+\t\telse\n+\t\t\t; /* no output */\n+\n \t\treturn 1;\n \t}\n \tif (in_merge_bases(commit_b, commit_a)) {\n \t\toidcpy(result, a);\n+\t\tif (show(o, 3)) {\n+\t\t\toutput(o, 3, _(\"Fast-forwarding submodule %s to the following commit:\"), path);\n+\t\t\toutput_commit_title(o, commit_a);\n+\t\t} else if (show(o, 2))\n+\t\t\toutput(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(a));\n+\t\telse\n+\t\t\t; /* no output */\n+\n \t\treturn 1;\n \t}\n \n-- \n2.15.1 (Apple Git-101)\n\n"},{"id":"348006","messageId":"CABPp-BGGe3r_QiC5264xkj0cp2Vu6WoLQZeDGEJi4eOpUW9z3g@mail.gmail.com","threadId":"48510","inReplyTo":"20180518194802.28355-2-leif.middelschulte@gmail.com","subject":"Re: [PATCH 1/1] Inform about fast-forwarding of submodules during merge","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2018-05-18T21:25:26Z","receivedAt":"2018-05-18T21:25:31Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi Leif,\n\nOn Fri, May 18, 2018 at 12:48 PM, Leif Middelschulte\n<leif.middelschulte@gmail.com> wrote:\n> From: Leif Middelschulte <Leif.Middelschulte@gmail.com>\n>\n> Silent fast-forwarding might lead to inconveniences in cases where\n> submodules are expected to have a certain revision, because 'more recent'\n> (therefore fast-forwardable) versions might break behavior/contain regressions.\n>\n> A use-case is the integration (merge) phase as part of the feature-centric\n> 'git-flow' workflow [0]. I.e. a feature might be well-tested with a certain\n> submodule revision, but break because of regressions (or changes in general)\n> within an updated version of the sourced submodule.\n>\n> This change tries to support the integrator by telling her about another possible\n> source of unexpected behavior (differing submodule versions) she might see\n> during integration tests.\n\nThanks for continuing to push on this.  This looks good so far (to\nme), but I was also hoping to see the analogy between these messages\nand \"Auto-merging $FILE\" for regular files mentioned.  Both Junio[1]\nand I[2] pointed out this similarity, and I think this\nsimilarity/analogy is useful additional motivation for making this\nchange.\n\n[1] https://public-inbox.org/git/xmqqo9hg7554.fsf@gitster-ct.c.googlers.com/\n[2] https://public-inbox.org/git/CABPp-BGaibCPWuCnaX5Af=sv-2zvyhNcupT+-PkxHDfJBg_Vbw@mail.gmail.com/\n\n\n> +               } else if (show(o, 2))\n> +                       output(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(b));\n...\n> +               } else if (show(o, 2))\n> +                       output(o, 2, _(\"Fast-forwarding submodule %s to %s\"), path, oid_to_hex(a));\n\nAlso, by analogy to the \"Auto-merging $FILE\" comparison, the \"to %s\"\non these two lines feels out of place.  Users can just look at the\nsubmodule to see what it was updated to.  In a sea of output from\nmerging, this extra detail feels like noise for the standard use-case,\nunless I'm misunderstanding how submodules are special.  Junio also\ncommented on this in the same email referenced above (at [1]).  Is\nthere a reason this is an important piece of the message for you to be\nshown at the standard merge verbosity?\n"},{"id":"348143","messageId":"20180521015739.GE652292@genre.crustytoothpaste.net","threadId":"48510","inReplyTo":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-05-21T01:57:40Z","receivedAt":"2018-05-21T01:58:11Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Thu, May 17, 2018 at 03:01:40PM +0900, Junio C Hamano wrote:\n> * bc/hash-independent-tests (2018-05-16) 28 commits\n>  - t5300: abstract away SHA-1-specific constants\n>  - t4208: abstract away SHA-1-specific constants\n>  - t4045: abstract away SHA-1-specific constants\n>  - t4042: abstract away SHA-1-specific constants\n>  - t4205: sort log output in a hash-independent way\n>  - t/lib-diff-alternative: abstract away SHA-1-specific constants\n>  - t4030: abstract away SHA-1-specific constants\n>  - t4029: abstract away SHA-1-specific constants\n>  - t4029: fix test indentation\n>  - t4022: abstract away SHA-1-specific constants\n>  - t4020: abstract away SHA-1-specific constants\n>  - t4014: abstract away SHA-1-specific constants\n>  - t4008: abstract away SHA-1-specific constants\n>  - t4007: abstract away SHA-1-specific constants\n>  - t3905: abstract away SHA-1-specific constants\n>  - t3702: abstract away SHA-1-specific constants\n>  - t3103: abstract away SHA-1-specific constants\n>  - t2203: abstract away SHA-1-specific constants\n>  - t: skip pack tests if not using SHA-1\n>  - t4044: skip test if not using SHA-1\n>  - t1512: skip test if not using SHA-1\n>  - t1007: annotate with SHA1 prerequisite\n>  - t0000: annotate with SHA1 prerequisite\n>  - t: switch $_x40 to $OID_REGEX\n>  - t/test-lib: introduce OID_REGEX\n>  - t: switch $_z40 to $ZERO_OID\n>  - t/test-lib: introduce ZERO_OID\n>  - t/test-lib: add an SHA1 prerequisite\n> \n>  Many tests hardcode the raw object names, which would change once\n>  we migrate away from SHA-1.  While some of them must test against\n>  exact object names, most of them do not have to use hardcoded\n>  constants in the test.  The latter kind of tests have been updated\n>  to test the moral equivalent of the original without hardcoding the\n>  actual object names.\n> \n>  Will merge to 'next'.\n\nI think there was one minor change Stefan wanted out of this series.\nI'll send a reroll (and tbdiff) with just that change.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"},{"id":"348177","messageId":"xmqqzi0t1waf.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"CABPp-BGGe3r_QiC5264xkj0cp2Vu6WoLQZeDGEJi4eOpUW9z3g@mail.gmail.com","subject":"Re: [PATCH 1/1] Inform about fast-forwarding of submodules during merge","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-21T04:12:56Z","receivedAt":"2018-05-21T04:13:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elijah Newren <newren@gmail.com> writes:\n\n> Thanks for continuing to push on this.  This looks good so far (to\n> me), but I was also hoping to see the analogy between these messages\n> and \"Auto-merging $FILE\" for regular files mentioned.  Both Junio[1]\n> and I[2] pointed out this similarity, and I think this\n> similarity/analogy is useful additional motivation for making this\n> change.\n\n... meaning that it should be discussed and named as the primary\nreason why this change is a good idea?\n\nRe-reading what Leif wrote in the first paragraph, I tend to think\nthat \"the more recent version may break us\" Leif gives is not a\nparticularly convincing one.  After all, if we did not change the\ncommit bound at a submodule since we forked, while they changed it\nto something else (either old or new), even though our changes may\nhave been fully tested with the version of the submodule we have\nbeen testing with, it may break with the version the merged branch\nhas been using.  Such an update is cleanly and silently resolved at\nthe tree-level three-way merge, but the risk of breakage is no\ndifferent to the case this patch adds new notices to.\n\nMore importantly, the same \"the changes we made may get broken by\nchanges in areas that are textually unrelated they made\" will happen\nwithout submodules.  Content-level three-way merges that resolves\ncleanly at the textual level may need to get semantic adjustment.\nDo we treat clean 3-way content merges as suspicious and give a\nsimilar warning?  That smells like madness.\n\nBut as you said, we give \"Auto-merging $FILE\" notice to clean 3-way\nmerge at the content-level for normal files, and there is no good\nreason why we should not do the same for submodules when one\nfast-forwards to the other, which is an analogue to the\ncontent-level 3-way merge where one branch's version is a superset\nof the other ones.  And that is quite a convincing reason why a new\n\"Auto-merging $SUBMODULE\" notice is a good idea.\n\n> ...\n> Also, by analogy to the \"Auto-merging $FILE\" comparison, the \"to %s\"\n> on these two lines feels out of place.  Users can just look at the\n> submodule to see what it was updated to.  In a sea of output from\n> merging, this extra detail feels like noise for the standard use-case,\n> unless I'm misunderstanding how submodules are special.\n\nNow you meantion it, that part of the message does look more like a\ndebugging aid than a feature that helps actual end-users.  After\nall, if our side did not change the commit recorded for the\nsubmodule while their side changed, we do not report the result of\nsuch a tree-level three-way merge that takes what commit they had at\ntheir tip.\n"},{"id":"348223","messageId":"CAGZ79kau121ZnwYVf0tFNvc1_G8Fxz55apgqLeok7Z8vQFZZdg@mail.gmail.com","threadId":"48510","inReplyTo":"20180521015739.GE652292@genre.crustytoothpaste.net","subject":"Re: What's cooking in git.git (May 2018, #02; Thu, 17)","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-21T17:36:38Z","receivedAt":"2018-05-21T17:37:38Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":">>  Many tests hardcode the raw object names, which would change once\n>>  we migrate away from SHA-1.  While some of them must test against\n>>  exact object names, most of them do not have to use hardcoded\n>>  constants in the test.  The latter kind of tests have been updated\n>>  to test the moral equivalent of the original without hardcoding the\n>>  actual object names.\n>>\n>>  Will merge to 'next'.\n>\n> I think there was one minor change Stefan wanted out of this series.\n> I'll send a reroll (and tbdiff) with just that change.\n\nI was just unsure how we treat [e]grep in our test suite, so I asked\nquestions out of sheer curiosity. I have no objections to the change\nmade, though.\n\nThanks!\n"},{"id":"348433","messageId":"1527174618.10589.4.camel@gmail.com","threadId":"48510","inReplyTo":"20180517133601.GC17548@sigill.intra.peff.net","subject":"jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-24T15:10:18Z","receivedAt":"2018-05-24T15:10:39Z","isPatch":false,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Thursday 17 May 2018 07:06 PM, Jeff King wrote:\n> But because git-branch does not kick in the pager until later\n> (because it only wants to do it for list-mode), that happens _after_\n> we've emitted the message.\n> \n\nI observe exactly the consequence of this behaviour. First, the error\nis emitted and then the pager kicks in to list the branches.\n\n\n> On the other hand, I'm not sure this is that big a deal. The point of\n> the deprecation warning is to catch people who are actually trying to\n> use \"-l\" as \"--create-reflog\", and that case does not page. The people\n> doing \"git branch -l\" are actually getting what they want eventually,\n> which is to turn it into \"--list\". In the interim step where it becomes\n> an unknown option, they'll get a hard error. \n\nI just thought we wouldn't want to surprise/confuse users who try to\nuse \"git branch -l\" with the warning message about \"create reflog\"\nalong-side the list of branches. That would just add to the confusion.\nSo, I thought we should error out when users do \"git branch -l\"\ninstead. Something like the following should help us prevent \"git\nbranch -l\" from listing branch names and might also prevent the\nconfusion.\n\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 452742fec..f3c5181bb 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -672,7 +672,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n        argc = parse_options(argc, argv, prefix, options, builtin_branch_usage,\n                             0);\n \n-       if (!delete && !rename && !copy && !edit_description && !new_upstream && !unset_upstream && argc == 0)\n+       if (!delete && !rename && !copy && !edit_description && !new_upstream && !unset_upstream && !reflog && argc == 0)\n                list = 1;\n \n        if (filter.with_commit || filter.merge != REF_FILTER_MERGED_NONE || filter.points_at.nr ||\n\n\n-- \nKaartic"},{"id":"348469","messageId":"20180524192214.GA21535@sigill.intra.peff.net","threadId":"48510","inReplyTo":"1527174618.10589.4.camel@gmail.com","subject":"Re: jk/branch-l-0-deprecation (was Re: What's cooking in git.git (May 2018, #02; Thu, 17))","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-24T19:22:14Z","receivedAt":"2018-05-24T19:22:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 24, 2018 at 08:40:18PM +0530, Kaartic Sivaraam wrote:\n\n> > On the other hand, I'm not sure this is that big a deal. The point of\n> > the deprecation warning is to catch people who are actually trying to\n> > use \"-l\" as \"--create-reflog\", and that case does not page. The people\n> > doing \"git branch -l\" are actually getting what they want eventually,\n> > which is to turn it into \"--list\". In the interim step where it becomes\n> > an unknown option, they'll get a hard error. \n> \n> I just thought we wouldn't want to surprise/confuse users who try to\n> use \"git branch -l\" with the warning message about \"create reflog\"\n> along-side the list of branches. That would just add to the confusion.\n> So, I thought we should error out when users do \"git branch -l\"\n> instead. Something like the following should help us prevent \"git\n> branch -l\" from listing branch names and might also prevent the\n> confusion.\n\nYeah, I think that's just a more extreme version of the current plan (it\nturns it immediately into a hard error instead of warning for a while).\nIf we just make the warning easier to see in the paged case, I think\nthat makes the current plan fine.\n\nI'll wrap up the patch I sent earlier.\n\n-Peff\n"},{"id":"348470","messageId":"20180524193105.GB21535@sigill.intra.peff.net","threadId":"48510","inReplyTo":"20180524192214.GA21535@sigill.intra.peff.net","subject":"[PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-24T19:31:05Z","receivedAt":"2018-05-24T19:31:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 24, 2018 at 03:22:14PM -0400, Jeff King wrote:\n\n> On Thu, May 24, 2018 at 08:40:18PM +0530, Kaartic Sivaraam wrote:\n> \n> > > On the other hand, I'm not sure this is that big a deal. The point of\n> > > the deprecation warning is to catch people who are actually trying to\n> > > use \"-l\" as \"--create-reflog\", and that case does not page. The people\n> > > doing \"git branch -l\" are actually getting what they want eventually,\n> > > which is to turn it into \"--list\". In the interim step where it becomes\n> > > an unknown option, they'll get a hard error. \n> > \n> > I just thought we wouldn't want to surprise/confuse users who try to\n> > use \"git branch -l\" with the warning message about \"create reflog\"\n> > along-side the list of branches. That would just add to the confusion.\n> > So, I thought we should error out when users do \"git branch -l\"\n> > instead. Something like the following should help us prevent \"git\n> > branch -l\" from listing branch names and might also prevent the\n> > confusion.\n> \n> Yeah, I think that's just a more extreme version of the current plan (it\n> turns it immediately into a hard error instead of warning for a while).\n> If we just make the warning easier to see in the paged case, I think\n> that makes the current plan fine.\n> \n> I'll wrap up the patch I sent earlier.\n\nHmm, actually, I suppose the true value of the warning is to help people\ndoing \"git branch -l foo\", and it would still work there. The \"more\nextreme\" from your suggested patch would only affect \"branch -l\".\n\nStill, I think I prefer the gentler version that we get by keeping it as\na warning even in the latter case.\n\nHere's the patch. It goes on top of jk/branch-l-0-deprecation (and will\nnaturally conflict with the removal branch, but the resolution should be\nobvious).\n\n-- >8 --\nSubject: [PATCH] branch: issue \"-l\" deprecation warning after pager starts\n\nIf you run \"git branch -l\", we issue a deprecation warning\nthat \"-l\" is probably not doing what you expect. But we do\nso while parsing the options, which is _before_ we start the\npager. Depending on your pager settings, this means that the\nwarning may get totally overwritten by the pager.\n\nInstead, let's delay the message until after we would have\nstarted the pager. If we do page, then it will end up inside\nthe pager (since we redirect stderr). And if not (including\nthe case when you really did mean for \"-l\" to work as\n\"--create-reflog\"), then it will still get shown on stderr.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/branch.c | 9 +++++++--\n 1 file changed, 7 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex e50a5a1680..55bfacd843 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -34,6 +34,7 @@ static const char * const builtin_branch_usage[] = {\n \tNULL\n };\n \n+static int used_deprecated_reflog_option;\n static const char *head;\n static struct object_id head_oid;\n \n@@ -573,8 +574,7 @@ static int edit_branch_description(const char *branch_name)\n static int deprecated_reflog_option_cb(const struct option *opt,\n \t\t\t\t       const char *arg, int unset)\n {\n-\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n-\twarning(\"it will be removed in a future version of Git\");\n+\tused_deprecated_reflog_option = 1;\n \t*(int *)opt->value = !unset;\n \treturn 0;\n }\n@@ -700,6 +700,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n+\tif (used_deprecated_reflog_option) {\n+\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n+\t\twarning(\"it will be removed in a future version of Git\");\n+\t}\n+\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n-- \n2.17.0.1391.g6fdbf40724\n\n"},{"id":"348507","messageId":"xmqqh8mwpkgu.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180524193105.GB21535@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-25T01:55:45Z","receivedAt":"2018-05-25T01:55:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Hmm, actually, I suppose the true value of the warning is to help people\n> doing \"git branch -l foo\", and it would still work there. The \"more\n> extreme\" from your suggested patch would only affect \"branch -l\".\n\n> Still, I think I prefer the gentler version that we get by keeping it as\n> a warning even in the latter case.\n\n\"git branch -l newbranch [forkpoint]\" that warns \"We won't be doing\nreflog creation with -l\" is good, but \"git branch -l\" that warns \"We\nwon't be doing reflog creation with -l\" sounds like a pure noise, as\nthe user would say \"Irrelevant, I am not doing that anyway--I am\nlisting\".\n\nThe warning to prepare users for the next step jk/branch-l-1-removal\nshould say \"we won't be accepting '-l' as a silent and unadvertised\nsynonym soon. Spell it as --list\" when \"git branch -l\" is given, I\nwould think.\n\n> @@ -700,6 +700,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n>  \tif (list)\n>  \t\tsetup_auto_pager(\"branch\", 1);\n>  \n> +\tif (used_deprecated_reflog_option) {\n> +\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> +\t\twarning(\"it will be removed in a future version of Git\");\n> +\t}\n\nSo from that point of view, we may need a separate message to warn\nusers who _do_ want listing with '-l' before jk/branch-l-1-removal\nremoves it?  \n\nThe jk/branch-l-2-resurrection topic later repurposes '-l' for\n'--list' but until that happens 'git branch -l' will error not, no?\n\n\n"},{"id":"348509","messageId":"20180525024002.GA1998@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqqh8mwpkgu.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-25T02:40:03Z","receivedAt":"2018-05-25T02:40:14Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 25, 2018 at 10:55:45AM +0900, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Hmm, actually, I suppose the true value of the warning is to help people\n> > doing \"git branch -l foo\", and it would still work there. The \"more\n> > extreme\" from your suggested patch would only affect \"branch -l\".\n> \n> > Still, I think I prefer the gentler version that we get by keeping it as\n> > a warning even in the latter case.\n> \n> \"git branch -l newbranch [forkpoint]\" that warns \"We won't be doing\n> reflog creation with -l\" is good, but \"git branch -l\" that warns \"We\n> won't be doing reflog creation with -l\" sounds like a pure noise, as\n> the user would say \"Irrelevant, I am not doing that anyway--I am\n> listing\".\n> \n> The warning to prepare users for the next step jk/branch-l-1-removal\n> should say \"we won't be accepting '-l' as a silent and unadvertised\n> synonym soon. Spell it as --list\" when \"git branch -l\" is given, I\n> would think.\n\nI hoped that reminding them that \"-l is a synonym for --create-reflog\"\nwould serve as a gentle reminder that they're Doing It Wrong. I guess we\ncould be more explicit, though.\n\nIt is not \"we won't be accepting -l as a synonym\" though. It was never a\nsynonym, it's just that it didn't happen to do anything in list mode.\n\n> > @@ -700,6 +700,11 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n> >  \tif (list)\n> >  \t\tsetup_auto_pager(\"branch\", 1);\n> >  \n> > +\tif (used_deprecated_reflog_option) {\n> > +\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> > +\t\twarning(\"it will be removed in a future version of Git\");\n> > +\t}\n> \n> So from that point of view, we may need a separate message to warn\n> users who _do_ want listing with '-l' before jk/branch-l-1-removal\n> removes it?  \n> \n> The jk/branch-l-2-resurrection topic later repurposes '-l' for\n> '--list' but until that happens 'git branch -l' will error not, no?\n\nYes, after step 1 it will error out. Again, I hoped the existing message\nwould prepare people. But maybe we should do this on top of what I\nposted earlier?\n\n-- >8 --\nSubject: [PATCH] branch: customize \"-l\" warning in list mode\n\nPeople mistakenly use \"git branch -l\", thinking that it\ntriggers list mode. It doesn't, but the lack of non-option\narguments in that command does (and the \"-l\" becomes a\nsilent noop).\n\nSince afc968e579 (branch: deprecate \"-l\" option, 2018-03-26)\nwe've warned that \"-l\" is going away. But the warning text\nis primarily aimed at people who _meant_ to use \"-l\", as in\n\"git branch -l foo\". People who mistakenly said \"git branch\n-l\" may be left puzzled.\n\nLet's make it clear that:\n\n  1. No, \"-l\" didn't do what they thought here.\n\n  2. It's going away, and what they should do instead.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/branch.c | 10 ++++++++--\n 1 file changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 55bfacd843..b0b33dab94 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -701,8 +701,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n \tif (used_deprecated_reflog_option) {\n-\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n-\t\twarning(\"it will be removed in a future version of Git\");\n+\t\tif (list) {\n+\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n+\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n+\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n+\t\t} else {\n+\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n+\t\t\twarning(\"it will be removed in a future version of Git\");\n+\t\t}\n \t}\n \n \tif (delete) {\n-- \n2.17.0.1391.g6fdbf40724\n\n"},{"id":"348527","messageId":"xmqqd0xknmf1.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180525024002.GA1998@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-25T08:56:34Z","receivedAt":"2018-05-25T08:56:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> People mistakenly use \"git branch -l\", thinking that it\n> triggers list mode. It doesn't, but the lack of non-option\n> arguments in that command does (and the \"-l\" becomes a\n> silent noop).\n>\n> Since afc968e579 (branch: deprecate \"-l\" option, 2018-03-26)\n> we've warned that \"-l\" is going away. But the warning text\n> is primarily aimed at people who _meant_ to use \"-l\", as in\n> \"git branch -l foo\". People who mistakenly said \"git branch\n> -l\" may be left puzzled.\n\nYup, thanks for being extra explicit.  I do imagine there are quite\na few of us who would be puzzled without this update (but with the\nprevious one to unhide it from behind the pager).\n\n> Let's make it clear that:\n>\n>   1. No, \"-l\" didn't do what they thought here.\n>\n>   2. It's going away, and what they should do instead.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  builtin/branch.c | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/branch.c b/builtin/branch.c\n> index 55bfacd843..b0b33dab94 100644\n> --- a/builtin/branch.c\n> +++ b/builtin/branch.c\n> @@ -701,8 +701,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n>  \t\tsetup_auto_pager(\"branch\", 1);\n>  \n>  \tif (used_deprecated_reflog_option) {\n> -\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> -\t\twarning(\"it will be removed in a future version of Git\");\n> +\t\tif (list) {\n> +\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n> +\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n> +\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n> +\t\t} else {\n> +\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> +\t\t\twarning(\"it will be removed in a future version of Git\");\n> +\t\t}\n>  \t}\n>  \n>  \tif (delete) {\n"},{"id":"348530","messageId":"xmqq8t88nllj.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"xmqqd0xknmf1.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-25T09:14:16Z","receivedAt":"2018-05-25T09:14:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> -\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n>> -\t\twarning(\"it will be removed in a future version of Git\");\n>> +\t\tif (list) {\n>> +\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n>> +\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n>> +\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n>> +\t\t} else {\n>> +\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n>> +\t\t\twarning(\"it will be removed in a future version of Git\");\n>> +\t\t}\n\nBy the way, this is one of these times when I feel that we should\nhave a better multi-line message support in die/error/warning/info\nfunctions.  Ideally, I should be able to write\n\n\twarning(_(\"the '-l' option is an alias for '--create-reflog' and\\n\"\n\t\t  \"has no effect in list mode, This option will soon be\\n\"\n\t\t  \"removed and you should omit it (or use '--list' instead).\"));\n\nand warning() would:\n\n - do the sprintf formatting thing as necessary to prepare a long multi-line\n   message;\n\n - chomp that into lines at '\\n' boundary; and\n\n - give each of these lines with _(\"warning: \") prefixed.\n\nThat way, translators can choose to make the resulting message to\ndifferent number of lines from the original easily.\n\n\n"},{"id":"348538","messageId":"87lgc77wc7.fsf@evledraar.gmail.com","threadId":"48510","inReplyTo":"xmqqvabm6csb.fsf@gitster-ct.c.googlers.com","subject":"sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-05-25T12:28:56Z","receivedAt":"2018-05-25T12:29:02Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, May 17 2018, Junio C Hamano wrote:\n\n> * sb/submodule-move-nested (2018-03-29) 6 commits\n>   (merged to 'next' on 2018-04-25 at 86b177433a)\n>  + submodule: fixup nested submodules after moving the submodule\n>  + submodule-config: remove submodule_from_cache\n>  + submodule-config: add repository argument to submodule_from_{name, path}\n>  + submodule-config: allow submodule_free to handle arbitrary repositories\n>  + grep: remove \"repo\" arg from non-supporting funcs\n>  + submodule.h: drop declaration of connect_work_tree_and_git_dir\n>\n>  Moving a submodule that itself has submodule in it with \"git mv\"\n>  forgot to make necessary adjustment to the nested sub-submodules;\n>  now the codepath learned to recurse into the submodules.\n\nI didn't spot this earlier because I don't test this a lot, but I've\nbisected the following breakage down to da62f786d2 (\"submodule: fixup\nnested submodules after moving the submodule\", 2018-03-28) (and manually\nconfirmed by reverting). On Linux both Debian & CentOS I get tests 3 and\n4 failing with:\n\n     GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n\n-v -x output follows:\n\nexpecting success: \n\tmkdir submodule &&\n\t(cd submodule &&\n\t\tgit init &&\n\t\techo a >a &&\n\t\tgit add . &&\n\t\tgit commit -ma\n\t) &&\n\tmkdir super &&\n\t(cd super &&\n\t\tgit init &&\n\t\tgit submodule add ../submodule &&\n\t\tgit submodule add ../submodule a &&\n\t\tgit commit -m \"add as submodule and as a\" &&\n\t\tgit mv a b &&\n\t\tgit commit -m \"move a to b\"\n\t)\n\n+ mkdir submodule\n+ cd submodule\n+ git init\nInitialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/submodule/.git/\n+ echo a\n+ git add .\n+ git commit -ma\n[master (root-commit) 27e9f0e] a\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 a\n+ mkdir super\n+ cd super\n+ git init\nInitialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/super/.git/\n+ git submodule add ../submodule\nCloning into '/home/avar/g/git/t/trash directory.t7411-submodule-config/super/submodule'...\ndone.\n+ git submodule add ../submodule a\nCloning into '/home/avar/g/git/t/trash directory.t7411-submodule-config/super/a'...\ndone.\n+ git commit -m add as submodule and as a\n[master (root-commit) 5a1dac1] add as submodule and as a\n Author: A U Thor <author@example.com>\n 3 files changed, 8 insertions(+)\n create mode 100644 .gitmodules\n create mode 160000 a\n create mode 160000 submodule\n+ git mv a b\n+ git commit -m move a to b\n[master ab1e9c7] move a to b\n Author: A U Thor <author@example.com>\n 1 file changed, 0 insertions(+), 0 deletions(-)\n rename a => b (100%)\nok 1 - submodule config cache setup\n\nexpecting success: \n\ttest_when_finished \"rm -rf repo\" &&\n\ttest_create_repo repo &&\n\tcat >repo/.gitmodules <<-\\EOF &&\n\t[submodule \"s\"]\n\t\tpath\n\t\tignore\n\tEOF\n\t(\n\t\tcd repo &&\n\t\ttest_must_fail test-submodule-config \"\" s 2>actual &&\n\t\ttest_i18ngrep \"bad config\" actual\n\t)\n\n+ test_when_finished rm -rf repo\n+ test 0 = 0\n+ test_cleanup={ rm -rf repo\n\t\t} && (exit \"$eval_ret\"); eval_ret=$?; :\n+ test_create_repo repo\n+ test 1 = 1\n+ repo=repo\n+ mkdir -p repo\n+ cd repo\n+ /home/avar/g/git/t/../git-init --template=/home/avar/g/git/t/../templates/blt/\nInitialized empty Git repository in /home/avar/g/git/t/trash directory.t7411-submodule-config/repo/.git/\n+ mv .git/hooks .git/hooks-disabled\n+ cat\n+ cd repo\n+ test_must_fail test-submodule-config  s\n+ test_i18ngrep bad config actual\n+ test -n \n+ test x! = xbad config\n+ grep bad config actual\nfatal: bad config line 2 in file /home/avar/g/git/t/trash directory.t7411-submodule-config/repo/.gitmodules\n+ rm -rf repo\n+ exit 0\n+ eval_ret=0\n+ :\nok 2 - configuration parsing with error\n\nexpecting success: \n\t(cd super &&\n\t\ttest-submodule-config \\\n\t\t\tHEAD^ a \\\n\t\t\tHEAD b \\\n\t\t\tHEAD^ submodule \\\n\t\t\tHEAD submodule \\\n\t\t\t\t>actual &&\n\t\ttest_cmp expect actual\n\t)\n\n+ cd super\n+ test-submodule-config HEAD^ a HEAD b HEAD^ submodule HEAD submodule\nwarning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.submodule.path'. Skipping second one!\nwarning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.submodule.url'. Skipping second one!\nwarning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.a.path'. Skipping second one!\nwarning: ab1e9c76c1e6a15df51b20e75552ec5ad00708ac:.gitmodules, multiple configurations found for 'submodule.a.url'. Skipping second one!\nSubmodule not found.\nUsage: /home/avar/g/git/t/helper/test-submodule-config [<commit> <submodulepath>] ...\nerror: last command exited with $?=1\nnot ok 3 - test parsing and lookup of submodule config by path\n#\t\n#\t\t(cd super &&\n#\t\t\ttest-submodule-config \\\n#\t\t\t\tHEAD^ a \\\n#\t\t\t\tHEAD b \\\n#\t\t\t\tHEAD^ submodule \\\n#\t\t\t\tHEAD submodule \\\n#\t\t\t\t\t>actual &&\n#\t\t\ttest_cmp expect actual\n#\t\t)\n#\t\n\nexpecting success: \n\t(cd super &&\n\t\ttest-submodule-config --name \\\n\t\t\tHEAD^ a \\\n\t\t\tHEAD a \\\n\t\t\tHEAD^ submodule \\\n\t\t\tHEAD submodule \\\n\t\t\t\t>actual &&\n\t\ttest_cmp expect actual\n\t)\n\n+ cd super\n+ test-submodule-config --name HEAD^ a HEAD a HEAD^ submodule HEAD submodule\n+ test_cmp expect actual\n+ diff -u expect actual\n--- expect\t2018-05-25 12:28:30.000000000 +0000\n+++ actual\t2018-05-25 12:28:30.000000000 +0000\n@@ -1,4 +1,4 @@\n Submodule name: 'a' for path 'a'\n-Submodule name: 'a' for path 'b'\n+Submodule name: 'a' for path 'a'\n Submodule name: 'submodule' for path 'submodule'\n Submodule name: 'submodule' for path 'submodule'\nerror: last command exited with $?=1\nnot ok 4 - test parsing and lookup of submodule config by name\n#\t\n#\t\t(cd super &&\n#\t\t\ttest-submodule-config --name \\\n#\t\t\t\tHEAD^ a \\\n#\t\t\t\tHEAD a \\\n#\t\t\t\tHEAD^ submodule \\\n#\t\t\t\tHEAD submodule \\\n#\t\t\t\t\t>actual &&\n#\t\t\ttest_cmp expect actual\n#\t\t)\n#\t\n\nexpecting success: \n\t(cd super &&\n\t\tcp .gitmodules .gitmodules.bak &&\n\t\techo \"\tvalue = \\\"\" >>.gitmodules &&\n\t\tgit add .gitmodules &&\n\t\tmv .gitmodules.bak .gitmodules &&\n\t\tgit commit -m \"add error\" &&\n\t\ttest-submodule-config \\\n\t\t\tHEAD b \\\n\t\t\tHEAD submodule \\\n\t\t\t\t>actual &&\n\t\ttest_cmp expect_error actual\n\t)\n\n+ cd super\n+ cp .gitmodules .gitmodules.bak\n+ echo \tvalue = \"\n+ git add .gitmodules\n+ mv .gitmodules.bak .gitmodules\n+ git commit -m add error\n[master 7cb6f0e] add error\n Author: A U Thor <author@example.com>\n 1 file changed, 2 insertions(+), 1 deletion(-)\n+ test-submodule-config HEAD b HEAD submodule\nerror: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules\n+ test_cmp expect_error actual\n+ diff -u expect_error actual\nok 5 - error in one submodule config lets continue\n\nexpecting success: \n\t(cd super &&\n\t\tsha1=$(git rev-parse HEAD) &&\n\t\ttest-submodule-config \\\n\t\t\tHEAD b \\\n\t\t\tHEAD submodule \\\n\t\t\t\t2>actual_err &&\n\t\ttest_i18ngrep \"submodule-blob $sha1:.gitmodules\" actual_err >/dev/null\n\t)\n\n+ cd super\n+ git rev-parse HEAD\n+ sha1=7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4\n+ test-submodule-config HEAD b HEAD submodule\nSubmodule name: 'a' for path 'b'\nSubmodule name: 'submodule' for path 'submodule'\n+ test_i18ngrep submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules actual_err\n+ test -n \n+ test x! = xsubmodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules\n+ grep submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules actual_err\nok 6 - error message contains blob reference\n\nexpecting success: \n\t(\n\t\tcd super &&\n\t\tgit tag new_tag &&\n\t\ttree=$(git rev-parse HEAD^{tree}) &&\n\t\tcommit=$(git rev-parse HEAD^{commit}) &&\n\t\ttest-submodule-config $commit b >expect &&\n\t\ttest-submodule-config $tree b >actual.1 &&\n\t\ttest-submodule-config new_tag b >actual.2 &&\n\t\ttest_cmp expect actual.1 &&\n\t\ttest_cmp expect actual.2\n\t)\n\n+ cd super\n+ git tag new_tag\n+ git rev-parse HEAD^{tree}\n+ tree=934687743cd5ca685cfa8d3c77aaebb75ee12e1f\n+ git rev-parse HEAD^{commit}\n+ commit=7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4\n+ test-submodule-config 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4 b\nerror: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules\n+ test-submodule-config 934687743cd5ca685cfa8d3c77aaebb75ee12e1f b\nerror: bad config line 7 in submodule-blob 934687743cd5ca685cfa8d3c77aaebb75ee12e1f:.gitmodules\n+ test-submodule-config new_tag b\nerror: bad config line 7 in submodule-blob 7cb6f0e38e67568f41da9828cc7d5eb1c753b7b4:.gitmodules\n+ test_cmp expect actual.1\n+ diff -u expect actual.1\n+ test_cmp expect actual.2\n+ diff -u expect actual.2\nok 7 - using different treeishs works\n\nexpecting success: \n\t(cd super &&\n\t\tgit config -f .gitmodules \\\n\t\t\tsubmodule.submodule.fetchrecursesubmodules blabla &&\n\t\tgit add .gitmodules &&\n\t\tgit config --unset -f .gitmodules \\\n\t\t\tsubmodule.submodule.fetchrecursesubmodules &&\n\t\tgit commit -m \"add error in fetchrecursesubmodules\" &&\n\t\ttest-submodule-config \\\n\t\t\tHEAD b \\\n\t\t\tHEAD submodule \\\n\t\t\t\t>actual &&\n\t\ttest_cmp expect_error actual  &&\n\t\tgit reset --hard HEAD^\n\t)\n\n+ cd super\n+ git config -f .gitmodules submodule.submodule.fetchrecursesubmodules blabla\n+ git add .gitmodules\n+ git config --unset -f .gitmodules submodule.submodule.fetchrecursesubmodules\n+ git commit -m add error in fetchrecursesubmodules\n[master 1fa1547] add error in fetchrecursesubmodules\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+), 1 deletion(-)\n+ test-submodule-config HEAD b HEAD submodule\n+ test_cmp expect_error actual\n+ diff -u expect_error actual\n+ git reset --hard HEAD^\nHEAD is now at 7cb6f0e add error\nok 8 - error in history in fetchrecursesubmodule lets continue\n\n# failed 2 among 8 test(s)\n1..8\n"},{"id":"348547","messageId":"20180525171050.GC10461@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqq8t88nllj.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-25T17:10:51Z","receivedAt":"2018-05-25T17:10:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 25, 2018 at 06:14:16PM +0900, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> >> -\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> >> -\t\twarning(\"it will be removed in a future version of Git\");\n> >> +\t\tif (list) {\n> >> +\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n> >> +\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n> >> +\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n> >> +\t\t} else {\n> >> +\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> >> +\t\t\twarning(\"it will be removed in a future version of Git\");\n> >> +\t\t}\n> \n> By the way, this is one of these times when I feel that we should\n> have a better multi-line message support in die/error/warning/info\n> functions.  Ideally, I should be able to write\n> \n> \twarning(_(\"the '-l' option is an alias for '--create-reflog' and\\n\"\n> \t\t  \"has no effect in list mode, This option will soon be\\n\"\n> \t\t  \"removed and you should omit it (or use '--list' instead).\"));\n> \n> and warning() would:\n> \n>  - do the sprintf formatting thing as necessary to prepare a long multi-line\n>    message;\n> \n>  - chomp that into lines at '\\n' boundary; and\n> \n>  - give each of these lines with _(\"warning: \") prefixed.\n> \n> That way, translators can choose to make the resulting message to\n> different number of lines from the original easily.\n\nYep, I totally agree. In past discussions I was thinking mostly of\nthe pain of writing these multi-line messages. But I imagine it is\nabsolute hell for translators, and we should fix it for that reason.\n\n(Also, I guess this message probably ought to be marked for\ntranslation).\n\n-Peff\n"},{"id":"348548","messageId":"CAGZ79kYC=Yrw1GXLAswJyY=E3diJSp7c1bBhp4hsgnw-ApHrXw@mail.gmail.com","threadId":"48510","inReplyTo":"87lgc77wc7.fsf@evledraar.gmail.com","subject":"Re: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-25T17:27:07Z","receivedAt":"2018-05-25T17:27:11Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Hi Ævar,\n\nOn Fri, May 25, 2018 at 5:28 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n> On Thu, May 17 2018, Junio C Hamano wrote:\n>\n>> * sb/submodule-move-nested (2018-03-29) 6 commits\n>>   (merged to 'next' on 2018-04-25 at 86b177433a)\n>>  + submodule: fixup nested submodules after moving the submodule\n>>  + submodule-config: remove submodule_from_cache\n>>  + submodule-config: add repository argument to submodule_from_{name, path}\n>>  + submodule-config: allow submodule_free to handle arbitrary repositories\n>>  + grep: remove \"repo\" arg from non-supporting funcs\n>>  + submodule.h: drop declaration of connect_work_tree_and_git_dir\n>>\n>>  Moving a submodule that itself has submodule in it with \"git mv\"\n>>  forgot to make necessary adjustment to the nested sub-submodules;\n>>  now the codepath learned to recurse into the submodules.\n>\n> I didn't spot this earlier because I don't test this a lot, but I've\n> bisected the following breakage down to da62f786d2 (\"submodule: fixup\n> nested submodules after moving the submodule\", 2018-03-28) (and manually\n> confirmed by reverting). On Linux both Debian & CentOS I get tests 3 and\n> 4 failing with:\n>\n>      GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n\nI can reproduce this. I'll look into it.\n"},{"id":"348556","messageId":"CAGZ79kae4k=uLx-oX5emxas4KrqObzQhzgir0coOSBzzpO8APw@mail.gmail.com","threadId":"48510","inReplyTo":"87lgc77wc7.fsf@evledraar.gmail.com","subject":"Re: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-05-25T19:49:47Z","receivedAt":"2018-05-25T19:49:51Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, May 25, 2018 at 5:28 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n> On Thu, May 17 2018, Junio C Hamano wrote:\n>\n>> * sb/submodule-move-nested (2018-03-29) 6 commits\n>>   (merged to 'next' on 2018-04-25 at 86b177433a)\n>>  + submodule: fixup nested submodules after moving the submodule\n>>  + submodule-config: remove submodule_from_cache\n>>  + submodule-config: add repository argument to submodule_from_{name, path}\n>>  + submodule-config: allow submodule_free to handle arbitrary repositories\n>>  + grep: remove \"repo\" arg from non-supporting funcs\n>>  + submodule.h: drop declaration of connect_work_tree_and_git_dir\n>>\n>>  Moving a submodule that itself has submodule in it with \"git mv\"\n>>  forgot to make necessary adjustment to the nested sub-submodules;\n>>  now the codepath learned to recurse into the submodules.\n>\n> I didn't spot this earlier because I don't test this a lot, but I've\n> bisected the following breakage down to da62f786d2 (\"submodule: fixup\n> nested submodules after moving the submodule\", 2018-03-28) (and manually\n> confirmed by reverting). On Linux both Debian & CentOS I get tests 3 and\n> 4 failing with:\n>\n>      GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n>\n> -v -x output follows:\n>\n> expecting success:\n>         mkdir submodule &&\n>         (cd submodule &&\n>                 git init &&\n>                 echo a >a &&\n>                 git add . &&\n>                 git commit -ma\n>         ) &&\n>         mkdir super &&\n>         (cd super &&\n>                 git init &&\n>                 git submodule add ../submodule &&\n>                 git submodule add ../submodule a &&\n>                 git commit -m \"add as submodule and as a\" &&\n>                 git mv a b &&\n>                 git commit -m \"move a to b\"\n>         )\n\nwhen you add a test_pause here and dump the\nstate of the setup, then it can be observed that when the fsmonitor is active\nthe last commit is different; without fsmonitor the moved gitlink and the change\nto the .gitmodules file is part of the commit, i.e.\n\n$ git -C super show\n        commit d3d90b70a01bd17d026f75a803c8b65f5903a7c0 (HEAD -> master)\n        Author: A U Thor <author@example.com>\n        Date:   Fri May 25 19:21:58 2018 +0000\n\n            move a to b\n\n        diff --git a/.gitmodules b/.gitmodules\n        index 3f4d474..6149210 100644\n        --- a/.gitmodules\n        +++ b/.gitmodules\n        @@ -2,5 +2,5 @@\n          path = submodule\n          url = ../submodule\n         [submodule \"a\"]\n        - path = a\n        + path = b\n          url = ../submodule\n        diff --git a/a b/b\n        similarity index 100%\n        rename from a\n        rename to b\nWhen running with the fsmonitor:\n\n$ git -C super show\n        commit 57022a92acf46f303498c045440ec099cbc35a2d (HEAD -> master)\n        Author: A U Thor <author@example.com>\n        Date:   Fri May 25 19:22:52 2018 +0000\n\n            move a to b\n\n        diff --git a/a b/b\n        similarity index 100%\n        rename from a\n        rename to b\n$ git -C super diff\n        diff --git a/.gitmodules b/.gitmodules\n        index 3f4d474..6149210 100644\n        --- a/.gitmodules\n        +++ b/.gitmodules\n        @@ -2,5 +2,5 @@\n          path = submodule\n          url = ../submodule\n         [submodule \"a\"]\n        - path = a\n        + path = b\n          url = ../submodule\n\nThis hints at a problem with git commit;\n\nI tried adding test_tick, to unconfuse the fsmonitor, but that doesn't help,\ndigging further, the problem is in the git mv command, which fails to\nadd the change in\n.gitmodules to the index.\n\nAdding the verbose flag to stage_updated_gitmodules() that is called by\ngit-mv very late in the game, such that\n\nvoid stage_updated_gitmodules(struct index_state *istate)\n{\n    trace_printf(\"staging .gitmodules files\");\n    if (add_file_to_index(istate, GITMODULES_FILE, ADD_CACHE_VERBOSE))\n        die(_(\"staging updated .gitmodules failed\"));\n}\n\nWe would get a message if the .gitmodules file is staged correctly, as\nadd_file_to_index() that calls add_to_index that would print\n\n    if (verbose && !was_same)\n        printf(\"add '%s'\\n\", path);\n\nI could not see that message, so I suspect, that there is something\nracy.\n\nWill debug further.\n"},{"id":"348558","messageId":"cover.1527279322.git.martin.agren@gmail.com","threadId":"48510","inReplyTo":"xmqq8t88nllj.fsf@gitster-ct.c.googlers.com","subject":"[RFC PATCH 0/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-25T21:00:52Z","receivedAt":"2018-05-25T21:01:24Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 25 May 2018 at 11:14, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>>> +                    warning(\"the '-l' option is an alias for '--create-reflog' and\");\n>>> +                    warning(\"has no effect in list mode. This option will soon be\");\n>>> +                    warning(\"removed and you should omit it (or use '--list' instead).\");\n>\n> By the way, this is one of these times when I feel that we should\n> have a better multi-line message support in die/error/warning/info\n> functions.  Ideally, I should be able to write\n[...]\n>         warning(_(\"the '-l' option is an alias for '--create-reflog' and\\n\"\n>                   \"has no effect in list mode, This option will soon be\\n\"\n>                   \"removed and you should omit it (or use '--list' instead).\"));\n[...]\n> and warning() would:\n>\n>  - do the sprintf formatting thing as necessary to prepare a long multi-line\n>    message;\n>\n>  - chomp that into lines at '\\n' boundary; and\n>\n>  - give each of these lines with _(\"warning: \") prefixed.\n>\n> That way, translators can choose to make the resulting message to\n> different number of lines from the original easily.\n\nHow about something like this? The first two patches implement the\nabove three points, except for the translation of \"warning: \".\n\nThe third patch is the main reason this is marked RFC. It translates\n\"warning: \" and similar, and breaks quite a few tests under\nGETTEXT_POISON since we grep for, e.g., \"warning\" on stderr. I could\nannotate those tests, but since I'm running out of time anyway, I\nthought I'd post this as a heads-up of \"I'm looking into this\".\n\nI do wonder: If our tests rely on grepping for \"warning\" (for pretty\ngood reasons), how many scripts out there do something similar (for\nmaybe-not-so-good reasons, but still)? Do we want to avoid breaking\nthem?\n\nAlso left to do is to convert any existing lego-ing users to the\nsingle-string form that Junio wished for above.\n\nMartin\n\nMartin Ågren (3):\n  usage: extract `prefix_suffix_lines()` from `advise()`\n  usage: prefix all lines in `vreportf()`, not just the first\n  usage: translate the \"error: \"-prefix and others\n\n t/t1011-read-tree-sparse-checkout.sh |  6 ++---\n t/t1506-rev-parse-diagnosis.sh       |  2 +-\n t/t1600-index.sh                     |  6 ++---\n t/t3600-rm.sh                        | 36 ++++++++++++-------------\n t/t5512-ls-remote.sh                 |  6 ++---\n t/t7607-merge-overwrite.sh           |  6 ++---\n t/t7609-merge-co-error-msgs.sh       | 39 ++++++++++++++--------------\n git-compat-util.h                    |  8 ++++++\n advice.c                             | 18 ++++++-------\n usage.c                              | 28 ++++++++++++++++----\n 10 files changed, 89 insertions(+), 66 deletions(-)\n\n-- \n2.17.0.1181.g093e983b05\n\n"},{"id":"348559","messageId":"90ac0a41563f070a840076521d8935ad7c21beb9.1527279322.git.martin.agren@gmail.com","threadId":"48510","inReplyTo":"cover.1527279322.git.martin.agren@gmail.com","subject":"[RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-25T21:00:53Z","receivedAt":"2018-05-25T21:01:36Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"advice.c contains a useful code snippet which takes a multi-line string\nand prints the lines, prefixing and suffixing each line with two\nconstant strings. This was originally added in 23cb5bf3b3 (i18n of\nmulti-line advice messages, 2011-12-22) to produce such output:\n\nhint: some multi-line advice\nhint: prefixed with \"hint: \"\n\nThe prefix is actually colored after 960786e761 (push: colorize errors,\n2018-04-21) and each line has a suffix for resetting the color.\n\nThe next commit will teach the same \"prefix all the lines\"-trick to the\ncode that produces, e.g., \"warning: \"-messages. In preparation for that,\nextract the code for printing the individual lines and expose it through\ngit-compat-util.h.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\nI'm open for suggestions on the naming of `prefix_suffix_lines()`...\n\n git-compat-util.h |  8 ++++++++\n advice.c          | 18 ++++++++----------\n usage.c           | 18 ++++++++++++++++++\n 3 files changed, 34 insertions(+), 10 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex f9e4c5f9bc..23445f7ab9 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -415,6 +415,14 @@ static inline char *git_find_last_dir_sep(const char *path)\n struct strbuf;\n \n /* General helper functions */\n+\n+/*\n+ * Write the message to the file, prefixing and suffixing\n+ * each line with `prefix` resp. `suffix`.\n+ */\n+void prefix_suffix_lines(FILE *f, const char *prefix,\n+\t\t\t const char *message, const char *suffix);\n+\n extern void vreportf(const char *prefix, const char *err, va_list params);\n extern NORETURN void usage(const char *err);\n extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2)));\ndiff --git a/advice.c b/advice.c\nindex 370a56d054..ffb29e7ef4 100644\n--- a/advice.c\n+++ b/advice.c\n@@ -79,24 +79,22 @@ static struct {\n \n void advise(const char *advice, ...)\n {\n+\tstruct strbuf prefix = STRBUF_INIT;\n \tstruct strbuf buf = STRBUF_INIT;\n \tva_list params;\n-\tconst char *cp, *np;\n+\n+\tstrbuf_addf(&prefix, _(\"%shint: \"),\n+\t\t    advise_get_color(ADVICE_COLOR_HINT));\n \n \tva_start(params, advice);\n \tstrbuf_vaddf(&buf, advice, params);\n \tva_end(params);\n \n-\tfor (cp = buf.buf; *cp; cp = np) {\n-\t\tnp = strchrnul(cp, '\\n');\n-\t\tfprintf(stderr,\t_(\"%shint: %.*s%s\\n\"),\n-\t\t\tadvise_get_color(ADVICE_COLOR_HINT),\n-\t\t\t(int)(np - cp), cp,\n-\t\t\tadvise_get_color(ADVICE_COLOR_RESET));\n-\t\tif (*np)\n-\t\t\tnp++;\n-\t}\n+\tprefix_suffix_lines(stderr, prefix.buf, buf.buf,\n+\t\t\t    advise_get_color(ADVICE_COLOR_RESET));\n+\n \tstrbuf_release(&buf);\n+\tstrbuf_release(&prefix);\n }\n \n int git_default_advice_config(const char *var, const char *value)\ndiff --git a/usage.c b/usage.c\nindex cdd534c9df..80f9c1d14b 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -6,6 +6,24 @@\n #include \"git-compat-util.h\"\n #include \"cache.h\"\n \n+void prefix_suffix_lines(FILE *f,\n+\t\t\t const char *prefix,\n+\t\t\t const char *message,\n+\t\t\t const char *suffix)\n+{\n+\tconst char *cp, *np;\n+\n+\tfor (cp = message; *cp; cp = np) {\n+\t\tnp = strchrnul(cp, '\\n');\n+\t\tfprintf(f, \"%s%.*s%s\\n\",\n+\t\t\tprefix,\n+\t\t\t(int)(np - cp), cp,\n+\t\t\tsuffix);\n+\t\tif (*np)\n+\t\t\tnp++;\n+\t}\n+}\n+\n void vreportf(const char *prefix, const char *err, va_list params)\n {\n \tchar msg[4096];\n-- \n2.17.0.1181.g093e983b05\n\n"},{"id":"348560","messageId":"ef5b4e28e00ad0c95dbe625d2e7305957f9fe5ba.1527279322.git.martin.agren@gmail.com","threadId":"48510","inReplyTo":"cover.1527279322.git.martin.agren@gmail.com","subject":"[RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-25T21:00:54Z","receivedAt":"2018-05-25T21:01:40Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"Teach `vreportf()` to prefix all lines with the given prefix, not only\nthe first line. This matches how \"hint: \" is being shown, and affects\n\"error: \", \"fatal: \", \"usage: \", \"warning: \" and \"BUG: \" (as well as any\nout-of-tree and future users).\n\nNote that we need to adjust quite a few tests as a result of this\nchange. All of these changes are because we obviously need to prefix\nmore lines in various \"expect\"-files -- except for one instance of a\ntrailing empty line that disappears with this commit (see t7609). This\nis a very minor change, and arguably a good one.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\nLooking back at this, I wonder if the opposite approach would be better,\nthat is, making `advise()` use `vreportf()` after teaching the latter\nthe multi-line trick.\n\n t/t1011-read-tree-sparse-checkout.sh |  6 ++---\n t/t1506-rev-parse-diagnosis.sh       |  2 +-\n t/t1600-index.sh                     |  6 ++---\n t/t3600-rm.sh                        | 36 ++++++++++++-------------\n t/t5512-ls-remote.sh                 |  6 ++---\n t/t7607-merge-overwrite.sh           |  6 ++---\n t/t7609-merge-co-error-msgs.sh       | 39 ++++++++++++++--------------\n usage.c                              |  2 +-\n 8 files changed, 51 insertions(+), 52 deletions(-)\n\ndiff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\nindex 0c6f48f302..31b0702e6c 100755\n--- a/t/t1011-read-tree-sparse-checkout.sh\n+++ b/t/t1011-read-tree-sparse-checkout.sh\n@@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '\n \ttest_must_fail git checkout top 2>actual &&\n \tcat >expected <<\\EOF &&\n error: The following untracked working tree files would be overwritten by checkout:\n-\tsub/added\n-\tsub/addedtoo\n-Please move or remove them before you switch branches.\n+error: \tsub/added\n+error: \tsub/addedtoo\n+error: Please move or remove them before you switch branches.\n Aborting\n EOF\n \ttest_i18ncmp expected actual\ndiff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh\nindex 4ee009da66..80d35087b7 100755\n--- a/t/t1506-rev-parse-diagnosis.sh\n+++ b/t/t1506-rev-parse-diagnosis.sh\n@@ -11,7 +11,7 @@ test_did_you_mean ()\n \tsq=\"'\" &&\n \tcat >expected <<-EOF &&\n \tfatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.\n-\tDid you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n+\tfatal: Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n \tEOF\n \ttest_cmp expected error\n }\ndiff --git a/t/t1600-index.sh b/t/t1600-index.sh\nindex c4422312f4..39a707c94a 100755\n--- a/t/t1600-index.sh\n+++ b/t/t1600-index.sh\n@@ -16,7 +16,7 @@ test_expect_success 'bogus GIT_INDEX_VERSION issues warning' '\n \t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n \t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n \t\t\twarning: GIT_INDEX_VERSION set, but the value is invalid.\n-\t\t\tUsing version Z\n+\t\t\twarning: Using version Z\n \t\tEOF\n \t\ttest_i18ncmp expect.err actual.err\n \t)\n@@ -30,7 +30,7 @@ test_expect_success 'out of bounds GIT_INDEX_VERSION issues warning' '\n \t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n \t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n \t\t\twarning: GIT_INDEX_VERSION set, but the value is invalid.\n-\t\t\tUsing version Z\n+\t\t\twarning: Using version Z\n \t\tEOF\n \t\ttest_i18ncmp expect.err actual.err\n \t)\n@@ -54,7 +54,7 @@ test_expect_success 'out of bounds index.version issues warning' '\n \t\tgit add a 2>&1 | sed \"s/[0-9]//\" >actual.err &&\n \t\tsed -e \"s/ Z$/ /\" <<-\\EOF >expect.err &&\n \t\t\twarning: index.version set, but the value is invalid.\n-\t\t\tUsing version Z\n+\t\t\twarning: Using version Z\n \t\tEOF\n \t\ttest_i18ncmp expect.err actual.err\n \t)\ndiff --git a/t/t3600-rm.sh b/t/t3600-rm.sh\nindex b8fbdefcdc..cd4a10df2d 100755\n--- a/t/t3600-rm.sh\n+++ b/t/t3600-rm.sh\n@@ -771,10 +771,10 @@ test_expect_success 'setup for testing rm messages' '\n test_expect_success 'rm files with different staged content' '\n \tcat >expect <<-\\EOF &&\n \terror: the following files have staged content different from both the\n-\tfile and the HEAD:\n-\t    bar.txt\n-\t    foo.txt\n-\t(use -f to force removal)\n+\terror: file and the HEAD:\n+\terror:     bar.txt\n+\terror:     foo.txt\n+\terror: (use -f to force removal)\n \tEOF\n \techo content1 >foo.txt &&\n \techo content1 >bar.txt &&\n@@ -785,9 +785,9 @@ test_expect_success 'rm files with different staged content' '\n test_expect_success 'rm files with different staged content without hints' '\n \tcat >expect <<-\\EOF &&\n \terror: the following files have staged content different from both the\n-\tfile and the HEAD:\n-\t    bar.txt\n-\t    foo.txt\n+\terror: file and the HEAD:\n+\terror:     bar.txt\n+\terror:     foo.txt\n \tEOF\n \techo content2 >foo.txt &&\n \techo content2 >bar.txt &&\n@@ -798,8 +798,8 @@ test_expect_success 'rm files with different staged content without hints' '\n test_expect_success 'rm file with local modification' '\n \tcat >expect <<-\\EOF &&\n \terror: the following file has local modifications:\n-\t    foo.txt\n-\t(use --cached to keep the file, or -f to force removal)\n+\terror:     foo.txt\n+\terror: (use --cached to keep the file, or -f to force removal)\n \tEOF\n \tgit commit -m \"testing rm 3\" &&\n \techo content3 >foo.txt &&\n@@ -810,7 +810,7 @@ test_expect_success 'rm file with local modification' '\n test_expect_success 'rm file with local modification without hints' '\n \tcat >expect <<-\\EOF &&\n \terror: the following file has local modifications:\n-\t    bar.txt\n+\terror:     bar.txt\n \tEOF\n \techo content4 >bar.txt &&\n \ttest_must_fail git -c advice.rmhints=false rm bar.txt 2>actual &&\n@@ -820,8 +820,8 @@ test_expect_success 'rm file with local modification without hints' '\n test_expect_success 'rm file with changes in the index' '\n \tcat >expect <<-\\EOF &&\n \terror: the following file has changes staged in the index:\n-\t    foo.txt\n-\t(use --cached to keep the file, or -f to force removal)\n+\terror:     foo.txt\n+\terror: (use --cached to keep the file, or -f to force removal)\n \tEOF\n \tgit reset --hard &&\n \techo content5 >foo.txt &&\n@@ -833,7 +833,7 @@ test_expect_success 'rm file with changes in the index' '\n test_expect_success 'rm file with changes in the index without hints' '\n \tcat >expect <<-\\EOF &&\n \terror: the following file has changes staged in the index:\n-\t    foo.txt\n+\terror:     foo.txt\n \tEOF\n \ttest_must_fail git -c advice.rmhints=false rm foo.txt 2>actual &&\n \ttest_i18ncmp expect actual\n@@ -842,12 +842,12 @@ test_expect_success 'rm file with changes in the index without hints' '\n test_expect_success 'rm files with two different errors' '\n \tcat >expect <<-\\EOF &&\n \terror: the following file has staged content different from both the\n-\tfile and the HEAD:\n-\t    foo1.txt\n-\t(use -f to force removal)\n+\terror: file and the HEAD:\n+\terror:     foo1.txt\n+\terror: (use -f to force removal)\n \terror: the following file has changes staged in the index:\n-\t    bar1.txt\n-\t(use --cached to keep the file, or -f to force removal)\n+\terror:     bar1.txt\n+\terror: (use --cached to keep the file, or -f to force removal)\n \tEOF\n \techo content >foo1.txt &&\n \tgit add foo1.txt &&\ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex 6a949484d0..7e505163f6 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -131,9 +131,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' '\n \tcat >exp <<-EOF &&\n \tfatal: '\\''$does_not_exist'\\'' does not appear to be a git repository\n \tfatal: Could not read from remote repository.\n-\n-\tPlease make sure you have the correct access rights\n-\tand the repository exists.\n+\tfatal: \n+\tfatal: Please make sure you have the correct access rights\n+\tfatal: and the repository exists.\n \tEOF\n \t#\n \t# Do not expect \"git ls-remote <pattern>\" to work; ls-remote needs\ndiff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh\nindex dd8ab7ede1..985fbab0b0 100755\n--- a/t/t7607-merge-overwrite.sh\n+++ b/t/t7607-merge-overwrite.sh\n@@ -116,9 +116,9 @@ test_expect_success 'will not overwrite untracked subtree' '\n \n cat >expect <<\\EOF\n error: The following untracked working tree files would be overwritten by merge:\n-\tsub\n-\tsub2\n-Please move or remove them before you merge.\n+error: \tsub\n+error: \tsub2\n+error: Please move or remove them before you merge.\n Aborting\n EOF\n \ndiff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh\nindex e90413204e..54bc3d2c9c 100755\n--- a/t/t7609-merge-co-error-msgs.sh\n+++ b/t/t7609-merge-co-error-msgs.sh\n@@ -27,11 +27,11 @@ test_expect_success 'setup' '\n \n cat >expect <<\\EOF\n error: The following untracked working tree files would be overwritten by merge:\n-\tfive\n-\tfour\n-\tthree\n-\ttwo\n-Please move or remove them before you merge.\n+error: \tfive\n+error: \tfour\n+error: \tthree\n+error: \ttwo\n+error: Please move or remove them before you merge.\n Aborting\n EOF\n \n@@ -50,13 +50,13 @@ test_expect_success 'untracked files overwritten by merge (fast and non-fast for\n \n cat >expect <<\\EOF\n error: Your local changes to the following files would be overwritten by merge:\n-\tfour\n-\tthree\n-\ttwo\n-Please commit your changes or stash them before you merge.\n+error: \tfour\n+error: \tthree\n+error: \ttwo\n+error: Please commit your changes or stash them before you merge.\n error: The following untracked working tree files would be overwritten by merge:\n-\tfive\n-Please move or remove them before you merge.\n+error: \tfive\n+error: Please move or remove them before you merge.\n Aborting\n EOF\n \n@@ -70,9 +70,9 @@ test_expect_success 'untracked files or local changes ovewritten by merge' '\n \n cat >expect <<\\EOF\n error: Your local changes to the following files would be overwritten by checkout:\n-\trep/one\n-\trep/two\n-Please commit your changes or stash them before you switch branches.\n+error: \trep/one\n+error: \trep/two\n+error: Please commit your changes or stash them before you switch branches.\n Aborting\n EOF\n \n@@ -92,9 +92,9 @@ test_expect_success 'cannot switch branches because of local changes' '\n \n cat >expect <<\\EOF\n error: Your local changes to the following files would be overwritten by checkout:\n-\trep/one\n-\trep/two\n-Please commit your changes or stash them before you switch branches.\n+error: \trep/one\n+error: \trep/two\n+error: Please commit your changes or stash them before you switch branches.\n Aborting\n EOF\n \n@@ -106,9 +106,8 @@ test_expect_success 'not uptodate file porcelain checkout error' '\n \n cat >expect <<\\EOF\n error: Updating the following directories would lose untracked files in them:\n-\trep\n-\trep2\n-\n+error: \trep\n+error: \trep2\n Aborting\n EOF\n \ndiff --git a/usage.c b/usage.c\nindex 80f9c1d14b..6a5669922f 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -34,7 +34,7 @@ void vreportf(const char *prefix, const char *err, va_list params)\n \t\tif (iscntrl(*p) && *p != '\\t' && *p != '\\n')\n \t\t\t*p = '?';\n \t}\n-\tfprintf(stderr, \"%s%s\\n\", prefix, msg);\n+\tprefix_suffix_lines(stderr, prefix, msg, \"\");\n }\n \n static NORETURN void usage_builtin(const char *err, va_list params)\n-- \n2.17.0.1181.g093e983b05\n\n"},{"id":"348561","messageId":"0a709ff2b1af85d21e96d9e259f2ec9f69d3a94d.1527279322.git.martin.agren@gmail.com","threadId":"48510","inReplyTo":"cover.1527279322.git.martin.agren@gmail.com","subject":"[RFC PATCH 3/3] usage: translate the \"error: \"-prefix and others","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-25T21:00:55Z","receivedAt":"2018-05-25T21:01:45Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"Translate the \"error: \", \"fatal: \", \"usage: \" and \"warning: \" prefixes\nthat we use for reporting that kind of information.\n\nDo not translate \"BUG: \". We tend to prefer the messages themselves to\nbe non-translated (and they're not supposed to ever appear anyway) so it\nmakes sense to let the prefix be nontranslated, too.\n\nSigned-off-by: Martin Ågren <martin.agren@gmail.com>\n---\nThis change breaks several tests under GETTEXT_POISON, e.g. t6030 which\ndoes this:\n\n\tgit bisect skip > my_bisect_log.txt 2>&1 &&\n\tgrep \"warning\" my_bisect_log.txt\n\n usage.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/usage.c b/usage.c\nindex 6a5669922f..7709cb22e7 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -39,24 +39,24 @@ void vreportf(const char *prefix, const char *err, va_list params)\n \n static NORETURN void usage_builtin(const char *err, va_list params)\n {\n-\tvreportf(\"usage: \", err, params);\n+\tvreportf(_(\"usage: \"), err, params);\n \texit(129);\n }\n \n static NORETURN void die_builtin(const char *err, va_list params)\n {\n-\tvreportf(\"fatal: \", err, params);\n+\tvreportf(_(\"fatal: \"), err, params);\n \texit(128);\n }\n \n static void error_builtin(const char *err, va_list params)\n {\n-\tvreportf(\"error: \", err, params);\n+\tvreportf(_(\"error: \"), err, params);\n }\n \n static void warn_builtin(const char *warn, va_list params)\n {\n-\tvreportf(\"warning: \", warn, params);\n+\tvreportf(_(\"warning: \"), warn, params);\n }\n \n static int die_is_recursing_builtin(void)\n-- \n2.17.0.1181.g093e983b05\n\n"},{"id":"348575","messageId":"xmqq1sdzno3g.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"xmqqd0xknmf1.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-26T02:32:35Z","receivedAt":"2018-05-26T02:32:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Yup, thanks for being extra explicit.  I do imagine there are quite\n> a few of us who would be puzzled without this update (but with the\n> previous one to unhide it from behind the pager).\n\nWith these two patches queued on top of jk/branch-l-0-deprecation,\nthe follow-up patches jk/branch-l-1-removal that makes 'branch -l'\nto fail and then jk/branch-l-2-reincarnation that makes 'branch -l'\na synonym to 'branch --list' needs rebasing.  Both are trivial and\nhopefully I did them correctly.\n\n-- >8 --\nFrom: Jeff King <peff@peff.net>\nDate: Mon, 26 Mar 2018 03:29:22 -0400\nSubject: [PATCH] branch: drop deprecated \"-l\" option\n\nWe marked the \"-l\" option as deprecated back in <insert sha1\nhere>. Now that sufficient time has passed, let's follow\nthrough and get rid of it.\n\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Eric Sunshine <sunshine@sunshineco.com>\nReviewed-by: Jacob Keller <jacob.keller@gmail.com>\n[jc: added a few tests]\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/branch.c  | 14 --------------\n t/t3200-branch.sh | 12 ++++++++++++\n 2 files changed, 12 insertions(+), 14 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex b0b33dab94..01b35b3c3d 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -571,14 +571,6 @@ static int edit_branch_description(const char *branch_name)\n \treturn 0;\n }\n \n-static int deprecated_reflog_option_cb(const struct option *opt,\n-\t\t\t\t       const char *arg, int unset)\n-{\n-\tused_deprecated_reflog_option = 1;\n-\t*(int *)opt->value = !unset;\n-\treturn 0;\n-}\n-\n int cmd_branch(int argc, const char **argv, const char *prefix)\n {\n \tint delete = 0, rename = 0, copy = 0, force = 0, list = 0;\n@@ -622,12 +614,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n \t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n \t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n-\t\t{\n-\t\t\tOPTION_CALLBACK, 'l', NULL, &reflog, NULL,\n-\t\t\tN_(\"deprecated synonym for --create-reflog\"),\n-\t\t\tPARSE_OPT_NOARG | PARSE_OPT_HIDDEN,\n-\t\t\tdeprecated_reflog_option_cb\n-\t\t},\n \t\tOPT_BOOL(0, \"edit-description\", &edit_description,\n \t\t\t N_(\"edit the description for the branch\")),\n \t\tOPT__FORCE(&force, N_(\"force creation, move/rename, deletion\"), PARSE_OPT_NOCOMPLETE),\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex da97b8a62b..eca75d3ca1 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -45,6 +45,12 @@ test_expect_success 'git branch HEAD should fail' '\n \ttest_must_fail git branch HEAD\n '\n \n+test_expect_success 'git branch -l no longer is --create-reflog' '\n+\ttest_when_finished \"git branch -D new-branch-with-reflog || :\" &&\n+\ttest_must_fail git branch -l new-branch-with-reflog &&\n+\ttest_must_fail git rev-parse --verify refs/heads/new-branch-with-reflog\n+'\n+\n cat >expect <<EOF\n $_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n EOF\n@@ -288,6 +294,12 @@ test_expect_success 'git branch --list -v with --abbrev' '\n \n '\n \n+test_expect_failure 'git branch -l eventually is --list' '\n+\tgit branch --list >expect &&\n+\tgit branch -l >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'git branch --column' '\n \tCOLUMNS=81 git branch --column=column >actual &&\n \tcat >expected <<\\EOF &&\n-- \n2.17.0-775-ge144d126d7\n\n"},{"id":"348576","messageId":"xmqqwovrm9hb.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"xmqq1sdzno3g.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-26T02:33:36Z","receivedAt":"2018-05-26T02:33:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> With these two patches queued on top of jk/branch-l-0-deprecation,\n> the follow-up patches jk/branch-l-1-removal that makes 'branch -l'\n> to fail and then jk/branch-l-2-reincarnation that makes 'branch -l'\n> a synonym to 'branch --list' needs rebasing.  Both are trivial and\n> hopefully I did them correctly.\n>\n> -- >8 --\n> From: Jeff King <peff@peff.net>\n> Date: Mon, 26 Mar 2018 03:29:22 -0400\n> Subject: [PATCH] branch: drop deprecated \"-l\" option\n\nAnd this is the final \"reincarnation\" step.\n\n-- >8 --\nFrom: Jeff King <peff@peff.net>\nDate: Mon, 26 Mar 2018 03:29:48 -0400\nSubject: [PATCH] branch: make \"-l\" a synonym for \"--list\"\n\nThe other \"mode\" options of git-branch have short-option\naliases that are easy to type (e.g., \"-d\" and \"-m\"). Let's\ngive \"--list\" the same treatment.\n\nThis also makes it consistent with the similar \"git tag -l\"\noption.\n\nWe didn't do this originally because \"--create-reflog\" was\nsquatting on the \"-l\" option. Now that sufficient time has\npassed with that alias removed, we can finally repurpose it.\n\nSigned-off-by: Jeff King <peff@peff.net>\nReviewed-by: Eric Sunshine <sunshine@sunshineco.com>\nReviewed-by: Jacob Keller <jacob.keller@gmail.com>\n[jc: adjusted the new tests added earlier]\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/branch.c  | 2 +-\n t/t3200-branch.sh | 8 +-------\n 2 files changed, 2 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 01b35b3c3d..1d06f5c547 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -612,7 +612,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \t\tOPT_BIT('M', NULL, &rename, N_(\"move/rename a branch, even if target exists\"), 2),\n \t\tOPT_BIT('c', \"copy\", &copy, N_(\"copy a branch and its reflog\"), 1),\n \t\tOPT_BIT('C', NULL, &copy, N_(\"copy a branch, even if target exists\"), 2),\n-\t\tOPT_BOOL(0, \"list\", &list, N_(\"list branch names\")),\n+\t\tOPT_BOOL('l', \"list\", &list, N_(\"list branch names\")),\n \t\tOPT_BOOL(0, \"create-reflog\", &reflog, N_(\"create the branch's reflog\")),\n \t\tOPT_BOOL(0, \"edit-description\", &edit_description,\n \t\t\t N_(\"edit the description for the branch\")),\ndiff --git a/t/t3200-branch.sh b/t/t3200-branch.sh\nindex eca75d3ca1..022d6a41c8 100755\n--- a/t/t3200-branch.sh\n+++ b/t/t3200-branch.sh\n@@ -45,12 +45,6 @@ test_expect_success 'git branch HEAD should fail' '\n \ttest_must_fail git branch HEAD\n '\n \n-test_expect_success 'git branch -l no longer is --create-reflog' '\n-\ttest_when_finished \"git branch -D new-branch-with-reflog || :\" &&\n-\ttest_must_fail git branch -l new-branch-with-reflog &&\n-\ttest_must_fail git rev-parse --verify refs/heads/new-branch-with-reflog\n-'\n-\n cat >expect <<EOF\n $_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000\tbranch: Created from master\n EOF\n@@ -294,7 +288,7 @@ test_expect_success 'git branch --list -v with --abbrev' '\n \n '\n \n-test_expect_failure 'git branch -l eventually is --list' '\n+test_expect_success 'git branch -l is --list' '\n \tgit branch --list >expect &&\n \tgit branch -l >actual &&\n \ttest_cmp expect actual\n-- \n2.17.0-775-ge144d126d7\n\n"},{"id":"348577","messageId":"xmqqsh6fm9ag.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180525171050.GC10461@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-26T02:37:43Z","receivedAt":"2018-05-26T02:37:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> By the way, this is one of these times when I feel that we should\n>> have a better multi-line message support in die/error/warning/info\n>> functions.  Ideally, I should be able to write\n>> \n>> \twarning(_(\"the '-l' option is an alias for '--create-reflog' and\\n\"\n>> \t\t  \"has no effect in list mode, This option will soon be\\n\"\n>> \t\t  \"removed and you should omit it (or use '--list' instead).\"));\n>> \n>> and warning() would:\n>> \n>>  - do the sprintf formatting thing as necessary to prepare a long multi-line\n>>    message;\n>> \n>>  - chomp that into lines at '\\n' boundary; and\n>> \n>>  - give each of these lines with _(\"warning: \") prefixed.\n>> \n>> That way, translators can choose to make the resulting message to\n>> different number of lines from the original easily.\n>\n> Yep, I totally agree. In past discussions I was thinking mostly of\n> the pain of writing these multi-line messages. But I imagine it is\n> absolute hell for translators, and we should fix it for that reason.\n>\n> (Also, I guess this message probably ought to be marked for\n> translation).\n\nNeedless to tell you, I worked backwards when noticing that these\nthree warning() lines are not marked for translation ;-).\n\nBut of course, fixing this in a naïve way will involve memory\nallocation during execution of die(), which may well be due to OOM,\nwhich is why we knew the need but haven't found a good solution to\nit.\n"},{"id":"348604","messageId":"ae75f388-edbc-8f00-e98c-825027a58c1c@gmail.com","threadId":"48510","inReplyTo":"20180524193105.GB21535@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-26T18:45:40Z","receivedAt":"2018-05-26T18:45:52Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Friday 25 May 2018 01:01 AM, Jeff King wrote:\n> On Thu, May 24, 2018 at 03:22:14PM -0400, Jeff King wrote:\n> \n> Hmm, actually, I suppose the true value of the warning is to help people\n> doing \"git branch -l foo\", and it would still work there. The \"more\n> extreme\" from your suggested patch would only affect \"branch -l\".\n> \n> Still, I think I prefer the gentler version that we get by keeping it as\n> a warning even in the latter case.\n>\n\nI never wanted to suppress the warning message in the latter case. I\njust wanted to avoid listing the branches. Actually the patch I sent in\none the previous threads[1] that avoids listing the branches has the\nfollowing behaviour,\n\n$ git branch -l\nwarning: the '-l' alias for '--create-reflog' is deprecated;\nwarning: it will be removed in a future version of Git\nusage: git branch [<options>] [-r | -a] [--merged | --no-merged]\n   or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]\n   or: git branch [<options>] [-r] (-d | -D) <branch-name>...\n   or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>\n   or: git branch [<options>] (-c | -C) [<old-branch>] <new-branch>\n   or: git branch [<options>] [-r | -a] [--points-at]\n   or: git branch [<options>] [-r | -a] [--format]\n\n\nSo, the warning message isn't lost. It just prevents the listing of\nbranches.\n\nWait, maybe I'm misunderstanding what you mean by \"warning\". You're\nprobably meaning something related to the way Git exits in both cases.\nWith your patch \"git branch -l\" prints a warning, lists the branches and\nhas an exit status of 0. With my patch it prints the warning, the usage\nspecifications with exit status 128. In that case, I still don't think\nit's bad to turn \"git branch -l\" into an error now as it's been\nincorrect for a long time now and it's not wrong if we correct it now.\n\nAnyways, if you think it mustn't turn into an error now and only in the\nnext stage, a suggestion follows in another thread.\n\n\n[1]: https://public-inbox.org/git/1527174618.10589.4.camel@gmail.com/\n\n\n-- \nSivaraam\n\nQUOTE:\n\n“The most valuable person on any team is the person who makes everyone\nelse on the team more valuable, not the person who knows the most.”\n\n      - John Sonmez\n\n\nSivaraam?\n\nYou possibly might have noticed that my signature recently changed from\n'Kaartic' to 'Sivaraam' both of which are parts of my name. I find the\nnew signature to be better for several reasons one of which is that the\nformer signature has a lot of ambiguities in the place I live as it is a\ncommon name (NOTE: it's not a common spelling, just a common name). So,\nI switched signatures before it's too late.\n\nThat said, I won't mind you calling me 'Kaartic' if you like it [of\ncourse ;-)]. You can always call me using either of the names.\n\n\nKIND NOTE TO THE NATIVE ENGLISH SPEAKER:\n\nAs I'm not a native English speaker myself, there might be mistaeks in\nmy usage of English. I apologise for any mistakes that I make.\n\nIt would be \"helpful\" if you take the time to point out the mistakes.\n\nIt would be \"super helpful\" if you could provide suggestions about how\nto correct those mistakes.\n\nThanks in advance!\n\n"},{"id":"348606","messageId":"1527363575.10290.3.camel@gmail.com","threadId":"48510","inReplyTo":"20180525024002.GA1998@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Kaartic Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-26T19:39:35Z","receivedAt":"2018-05-26T19:39:46Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Friday 25 May 2018 08:10 AM, Jeff King wrote:\n> Subject: [PATCH] branch: customize \"-l\" warning in list mode\n> \n> People mistakenly use \"git branch -l\", thinking that it\n> triggers list mode. It doesn't, but the lack of non-option\n> arguments in that command does (and the \"-l\" becomes a\n> silent noop).\n> > Since afc968e579 (branch: deprecate \"-l\" option, 2018-03-26)\n> \n> we've warned that \"-l\" is going away. But the warning text\n> is primarily aimed at people who _meant_ to use \"-l\", as in\n> \"git branch -l foo\". People who mistakenly said \"git branch\n> -l\" may be left puzzled.\n> \n\nSo, this patch is to improve the user experience of people who use \"git\nbranch -l\" for listing and not for the people who forget to give a new\nbranch name argument for \"-l\". In that case, this makes sense.\n\nBTW, I hope people don't start wondering why \"git branch -d\" doesn't\ntrigger list mode ;-)\n\n\n> +\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n> +\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n> +\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n\nI suppose s/alias/deprecated alias/ makes the point that '-l' will be\nremoved more stronger.\n\n\n-- \nSivaraam"},{"id":"348649","messageId":"xmqqmuwkjic7.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"90ac0a41563f070a840076521d8935ad7c21beb9.1527279322.git.martin.agren@gmail.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-28T08:27:20Z","receivedAt":"2018-05-28T08:27:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Ågren <martin.agren@gmail.com> writes:\n\n> I'm open for suggestions on the naming of `prefix_suffix_lines()`...\n\nIs there a verb that means \"have/place the thing in between two\nother things\" or \"Bring two things and place them on each side of\nthe third thing\" in a more concise way?  Wrap?  Sandwich?  Enclose?\n\n> +\n> +/*\n> + * Write the message to the file, prefixing and suffixing\n> + * each line with `prefix` resp. `suffix`.\n> + */\n> +void prefix_suffix_lines(FILE *f, const char *prefix,\n> +\t\t\t const char *message, const char *suffix);\n> +\n> ...\n> diff --git a/usage.c b/usage.c\n> index cdd534c9df..80f9c1d14b 100644\n> --- a/usage.c\n> +++ b/usage.c\n> @@ -6,6 +6,24 @@\n>  #include \"git-compat-util.h\"\n>  #include \"cache.h\"\n>  \n> +void prefix_suffix_lines(FILE *f,\n> +\t\t\t const char *prefix,\n> +\t\t\t const char *message,\n> +\t\t\t const char *suffix)\n> +{\n> +\tconst char *cp, *np;\n> +\n> +\tfor (cp = message; *cp; cp = np) {\n> +\t\tnp = strchrnul(cp, '\\n');\n> +\t\tfprintf(f, \"%s%.*s%s\\n\",\n> +\t\t\tprefix,\n> +\t\t\t(int)(np - cp), cp,\n> +\t\t\tsuffix);\n> +\t\tif (*np)\n> +\t\t\tnp++;\n> +\t}\n> +}\n> +\n>  void vreportf(const char *prefix, const char *err, va_list params)\n>  {\n>  \tchar msg[4096];\n\nI guess we can directly use this even in the codepath that\nimplements die() without having to worry about the helper making any\nextra allocation, which is good.\n\n\n"},{"id":"348651","messageId":"xmqqin78jfnl.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"ef5b4e28e00ad0c95dbe625d2e7305957f9fe5ba.1527279322.git.martin.agren@gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-28T09:25:18Z","receivedAt":"2018-05-28T09:25:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Ågren <martin.agren@gmail.com> writes:\n\n> diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\n> index 0c6f48f302..31b0702e6c 100755\n> --- a/t/t1011-read-tree-sparse-checkout.sh\n> +++ b/t/t1011-read-tree-sparse-checkout.sh\n> @@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '\n>  \ttest_must_fail git checkout top 2>actual &&\n>  \tcat >expected <<\\EOF &&\n>  error: The following untracked working tree files would be overwritten by checkout:\n> -\tsub/added\n> -\tsub/addedtoo\n> -Please move or remove them before you switch branches.\n> +error: \tsub/added\n> +error: \tsub/addedtoo\n> +error: Please move or remove them before you switch branches.\n>  Aborting\n>  EOF\n\nThis shows the typical effect of this series, which (I subjectively\nthink) gives us a more pleasant end-user experience.\n\n> diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh\n> index 4ee009da66..80d35087b7 100755\n> --- a/t/t1506-rev-parse-diagnosis.sh\n> +++ b/t/t1506-rev-parse-diagnosis.sh\n> @@ -11,7 +11,7 @@ test_did_you_mean ()\n>  \tsq=\"'\" &&\n>  \tcat >expected <<-EOF &&\n>  \tfatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.\n> -\tDid you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n> +\tfatal: Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?\n>  \tEOF\n\nAnd this, too.\n\n> diff --git a/usage.c b/usage.c\n> index 80f9c1d14b..6a5669922f 100644\n> --- a/usage.c\n> +++ b/usage.c\n> @@ -34,7 +34,7 @@ void vreportf(const char *prefix, const char *err, va_list params)\n>  \t\tif (iscntrl(*p) && *p != '\\t' && *p != '\\n')\n>  \t\t\t*p = '?';\n>  \t}\n> -\tfprintf(stderr, \"%s%s\\n\", prefix, msg);\n> +\tprefix_suffix_lines(stderr, prefix, msg, \"\");\n>  }\n\n"},{"id":"348680","messageId":"CACsJy8CZQLxU5TPx=M0NV_xTR_9qyjbOWnVcdX9-Tz+BCb24VA@mail.gmail.com","threadId":"48510","inReplyTo":"90ac0a41563f070a840076521d8935ad7c21beb9.1527279322.git.martin.agren@gmail.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-05-28T18:40:16Z","receivedAt":"2018-05-28T18:40:51Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, May 25, 2018 at 11:00 PM, Martin Ågren <martin.agren@gmail.com> wrote:\n> advice.c contains a useful code snippet which takes a multi-line string\n> and prints the lines, prefixing and suffixing each line with two\n> constant strings. This was originally added in 23cb5bf3b3 (i18n of\n> multi-line advice messages, 2011-12-22) to produce such output:\n>\n> hint: some multi-line advice\n> hint: prefixed with \"hint: \"\n>\n> The prefix is actually colored after 960786e761 (push: colorize errors,\n> 2018-04-21) and each line has a suffix for resetting the color.\n>\n> The next commit will teach the same \"prefix all the lines\"-trick to the\n> code that produces, e.g., \"warning: \"-messages. In preparation for that,\n> extract the code for printing the individual lines and expose it through\n> git-compat-util.h.\n>\n> Signed-off-by: Martin Ågren <martin.agren@gmail.com>\n> ---\n> I'm open for suggestions on the naming of `prefix_suffix_lines()`...\n\nI think the important verb, print (to FILE*), is somehow missing. This\ncurrent name would be great if it produces another str(buf).\n-- \nDuy\n"},{"id":"348681","messageId":"CACsJy8CgzDfbES2jC+Rv+bKj_JAk8dzEDCm89JMuBFQmyGg9Gw@mail.gmail.com","threadId":"48510","inReplyTo":"xmqqin78jfnl.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-05-28T18:45:19Z","receivedAt":"2018-05-28T18:45:53Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Mon, May 28, 2018 at 11:25 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Martin Ågren <martin.agren@gmail.com> writes:\n>\n>> diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\n>> index 0c6f48f302..31b0702e6c 100755\n>> --- a/t/t1011-read-tree-sparse-checkout.sh\n>> +++ b/t/t1011-read-tree-sparse-checkout.sh\n>> @@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '\n>>       test_must_fail git checkout top 2>actual &&\n>>       cat >expected <<\\EOF &&\n>>  error: The following untracked working tree files would be overwritten by checkout:\n>> -     sub/added\n>> -     sub/addedtoo\n>> -Please move or remove them before you switch branches.\n>> +error:       sub/added\n>> +error:       sub/addedtoo\n>> +error: Please move or remove them before you switch branches.\n>>  Aborting\n>>  EOF\n>\n> This shows the typical effect of this series, which (I subjectively\n> think) gives us a more pleasant end-user experience.\n\nAlso, very subjectively, I'm torn about this. To me, just one\n\"error/warning/fatal\" at the start of the first paragraph feels much\nbetter. If we have to somehow mark the second paragraph that \"this is\nalso part of the error message\" then it's probably better to rephrase.\n-- \nDuy\n"},{"id":"348684","messageId":"xmqq8t83ihd7.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"CACsJy8CgzDfbES2jC+Rv+bKj_JAk8dzEDCm89JMuBFQmyGg9Gw@mail.gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-28T21:45:56Z","receivedAt":"2018-05-28T21:46:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n>>> +error:       sub/added\n>>> +error:       sub/addedtoo\n>>> +error: Please move or remove them before you switch branches.\n>>>  Aborting\n>>>  EOF\n>>\n>> This shows the typical effect of this series, which (I subjectively\n>> think) gives us a more pleasant end-user experience.\n>\n> Also, very subjectively, I'm torn about this. To me, just one\n> \"error/warning/fatal\" at the start of the first paragraph feels much\n> better. If we have to somehow mark the second paragraph that \"this is\n> also part of the error message\" then it's probably better to rephrase.\n\nI personally can go either way.  If you prefer less noisy route, we\ncould change the function signature of vreportf() to take a prefix\nfor the first line and another prefix for the remaining lines and\npass that through down to the \"split and print with prefix\" helper.\n\nThat way, we can\n\n - allow callers to align 1st prefix (e.g. \"error: \") with the\n   leading indent for the second and subsequent lines by passing the\n   second prefix with appropriate display width.\n\n - allow translators to grow or shrink number of lines a given\n   message takes, and to decide where in the translated string to\n   wrap lines.\n\nEven though step 3/3 may become a bit awkward (the second prefix\nwould most likely be only whitespace, and you'd need to write\nsomething silly like _(\"\\t\")), we can still keep the alignment if we\nwanted to.\n\n"},{"id":"348688","messageId":"CAN0heSq1y3XibCFDYsae5b6jmzZOzcLHT4atCZ+KCb4dL5As0g@mail.gmail.com","threadId":"48510","inReplyTo":"xmqq8t83ihd7.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-29T04:49:39Z","receivedAt":"2018-05-29T04:49:44Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 28 May 2018 at 23:45, Junio C Hamano <gitster@pobox.com> wrote:\n> Duy Nguyen <pclouds@gmail.com> writes:\n>\n>>>> +error:       sub/added\n>>>> +error:       sub/addedtoo\n>>>> +error: Please move or remove them before you switch branches.\n>>>>  Aborting\n>>>>  EOF\n>>>\n>>> This shows the typical effect of this series, which (I subjectively\n>>> think) gives us a more pleasant end-user experience.\n>>\n>> Also, very subjectively, I'm torn about this. To me, just one\n>> \"error/warning/fatal\" at the start of the first paragraph feels much\n>> better. If we have to somehow mark the second paragraph that \"this is\n>> also part of the error message\" then it's probably better to rephrase.\n\nWould you feel the same about \"hint: \"? We already do prefix all the\nlines there. It seems to we we should probably do the same for \"hint: \"\nas for \"warning: \", whatever we decide is right.\n\n> I personally can go either way.  If you prefer less noisy route, we\n> could change the function signature of vreportf() to take a prefix\n> for the first line and another prefix for the remaining lines and\n> pass that through down to the \"split and print with prefix\" helper.\n>\n> That way, we can\n>\n>  - allow callers to align 1st prefix (e.g. \"error: \") with the\n>    leading indent for the second and subsequent lines by passing the\n>    second prefix with appropriate display width.\n\nI suspect this second prefix would always consist of\nstrlen(first_prefix) spaces? We should be able to construct it on the\nfly, without any need for manual counting and human mistakes.\n\n>\n>  - allow translators to grow or shrink number of lines a given\n>    message takes, and to decide where in the translated string to\n>    wrap lines.\n>\n> Even though step 3/3 may become a bit awkward (the second prefix\n> would most likely be only whitespace, and you'd need to write\n> something silly like _(\"\\t\")), we can still keep the alignment if we\n> wanted to.\n\nThanks both for your comments. I'll see what I can come up with.\n\nMartin\n"},{"id":"348692","messageId":"xmqqtvqrggdt.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"CAN0heSq1y3XibCFDYsae5b6jmzZOzcLHT4atCZ+KCb4dL5As0g@mail.gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-29T05:50:06Z","receivedAt":"2018-05-29T05:50:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Ågren <martin.agren@gmail.com> writes:\n\n>>  - allow callers to align 1st prefix (e.g. \"error: \") with the\n>>    leading indent for the second and subsequent lines by passing the\n>>    second prefix with appropriate display width.\n>\n> I suspect this second prefix would always consist of\n> strlen(first_prefix) spaces? We should be able to construct it on the\n> fly, without any need for manual counting and human mistakes.\n\nI wouldn't be so bold to claim that, given especially that we are\ntalking about i18n/l10n where byte count, character count and\ndisplay width are all different even on a terminal with fixed-width\nfont.\n\n\n"},{"id":"348694","messageId":"CAN0heSry9ncTTzjw2fB=wxTAo3YPyQq-wbONpXCsfi_Syxfj-A@mail.gmail.com","threadId":"48510","inReplyTo":"xmqqtvqrggdt.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-29T10:30:35Z","receivedAt":"2018-05-29T10:30:39Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 29 May 2018 at 07:50, Junio C Hamano <gitster@pobox.com> wrote:\n> Martin Ågren <martin.agren@gmail.com> writes:\n>\n>>>  - allow callers to align 1st prefix (e.g. \"error: \") with the\n>>>    leading indent for the second and subsequent lines by passing the\n>>>    second prefix with appropriate display width.\n>>\n>> I suspect this second prefix would always consist of\n>> strlen(first_prefix) spaces? We should be able to construct it on the\n>> fly, without any need for manual counting and human mistakes.\n>\n> I wouldn't be so bold to claim that, given especially that we are\n> talking about i18n/l10n where byte count, character count and\n> display width are all different even on a terminal with fixed-width\n> font.\n\nYou are of course correct. I should have my morning tea before typing.\n\nAbout the _(\"\\t\")-approach that you mentioned up-thread. It would allow\na translator to adjust all the indentations for a particular language.\nTo be clear, what you mean is _(\"         \" /* 9 spaces */) to align\nnicely with \"warning: \", which is the longest English string. Then the\ntranslator would translate the nine spaces and all of \"fatal:   \" and\nothers to padded strings, all of the same length (not necessarily nine).\nCorrect?\n\nThat approach seems a bit shaky, if nothing else because we may one day\nsimilarly want to use nine \"translated\" spaces in some other context. Or\nmaybe this is actually i18n-best-practices.\n\nIt also means that shorter prefixes are somewhat arbitrarily padded,\njust because there exists a longer prefix that some other code path may\nwant to use. OTOH, if a \"warning: \" is followed by an \"error:   \", both\nlines/blocks would have the same indentation, which might perhaps be\n(slightly) preferable.\n\nMartin\n"},{"id":"348696","messageId":"xmqqa7sihdf7.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"CAN0heSry9ncTTzjw2fB=wxTAo3YPyQq-wbONpXCsfi_Syxfj-A@mail.gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-29T12:08:44Z","receivedAt":"2018-05-29T12:08:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Ågren <martin.agren@gmail.com> writes:\n\n> About the _(\"\\t\")-approach that you mentioned up-thread. It would allow\n> a translator to adjust all the indentations for a particular language.\n> To be clear, what you mean is _(\"         \" /* 9 spaces */) to align\n> nicely with \"warning: \", which is the longest English string. Then the\n> translator would translate the nine spaces and all of \"fatal:   \" and\n> others to padded strings, all of the same length (not necessarily nine).\n> Correct?\n\nI was envisioning that these\n\n\terror: the first line of an error message\n\t       and the second line indented by 7 places (strlen(\"error:\")+1)\n\tinfo: the first line of an info message\n\t      and the second line indented by 6 places (strlen(\"info:\")+1)\n\nare produced by\n\n\tvreportf(\"error: \", \"       \" /* 7 spaces */,\n\t\t \"the first line of an error message\\nand the second ...\");\n\tvreportf(\"info: \", \"      \" /* 6 spaces */,\n\t\t \"the first line of an info message\\nand the second ...\");\n\nAnd if all of these string literals were inside _(), then depending\non how many display columns translated version of \"error\" and \"info\"\ntakes in the target language, these 7-space and 6-space secondary\nprefixes would be \"translated\" differently.\n\nOf course, since your language may translate \"error\" and \"fatal\" to\ndifferent display columns, the 7-space secondary prefix in this one\n\n\tvreportf(\"fatal: \", \"       \" /* 7 spaces */,\n\t\t \"the first line of a fatal error message\\nand the second ...\");\n\nneeds to be mapped to a string that is differnt from the 7-space for\n\"error: \".  I think you would use \"contexts\" to map the same source\n7-space to different translated string when it becomes necessary.\n\nhttps://www.gnu.org/software/gettext/manual/html_node/Contexts.html\n"},{"id":"348702","messageId":"CACsJy8C-BT158DW_Tz24ea_QUfQHQpToCC-=E+-zZeZeAD9heQ@mail.gmail.com","threadId":"48510","inReplyTo":"CAN0heSq1y3XibCFDYsae5b6jmzZOzcLHT4atCZ+KCb4dL5As0g@mail.gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-05-29T15:50:15Z","receivedAt":"2018-05-29T15:52:33Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Tue, May 29, 2018 at 6:49 AM, Martin Ågren <martin.agren@gmail.com> wrote:\n> On 28 May 2018 at 23:45, Junio C Hamano <gitster@pobox.com> wrote:\n>> Duy Nguyen <pclouds@gmail.com> writes:\n>>\n>>>>> +error:       sub/added\n>>>>> +error:       sub/addedtoo\n>>>>> +error: Please move or remove them before you switch branches.\n>>>>>  Aborting\n>>>>>  EOF\n>>>>\n>>>> This shows the typical effect of this series, which (I subjectively\n>>>> think) gives us a more pleasant end-user experience.\n>>>\n>>> Also, very subjectively, I'm torn about this. To me, just one\n>>> \"error/warning/fatal\" at the start of the first paragraph feels much\n>>> better. If we have to somehow mark the second paragraph that \"this is\n>>> also part of the error message\" then it's probably better to rephrase.\n>\n> Would you feel the same about \"hint: \"? We already do prefix all the\n> lines there. It seems to we we should probably do the same for \"hint: \"\n> as for \"warning: \", whatever we decide is right.\n\nIt may depend on context. Let's look at the commit that introduces\nthis \"hint:\" prefix, 38ef61cfde (advice: Introduce\nerror_resolve_conflict - 2011-08-04). The example in the commit\nmessage shows the hint paragraph sandwiched by an error and a fatal\none:\n\n      error: 'commit' is not possible because you have unmerged files.\n      hint: Fix them up in the work tree ...\n      hint: ...\n      fatal: Exiting because of an unresolved conflict.\n\nI think in this case (dense paragraphs of different message types) yes\nit might make sense to prefix lines with \"hint:\". But when there's\nonly one type of message like the \"error\" part quoted at the top, it\nfeels too verbose to have error: prefix everywhere.\n-- \nDuy\n"},{"id":"348722","messageId":"20180529211523.GA7964@sigill.intra.peff.net","threadId":"48510","inReplyTo":"ae75f388-edbc-8f00-e98c-825027a58c1c@gmail.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:15:23Z","receivedAt":"2018-05-29T21:15:39Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, May 27, 2018 at 12:15:40AM +0530, Kaartic Sivaraam wrote:\n\n> > Hmm, actually, I suppose the true value of the warning is to help people\n> > doing \"git branch -l foo\", and it would still work there. The \"more\n> > extreme\" from your suggested patch would only affect \"branch -l\".\n> > \n> > Still, I think I prefer the gentler version that we get by keeping it as\n> > a warning even in the latter case.\n> >\n> \n> I never wanted to suppress the warning message in the latter case. I\n> just wanted to avoid listing the branches. Actually the patch I sent in\n> one the previous threads[1] that avoids listing the branches has the\n> following behaviour,\n> \n> $ git branch -l\n> warning: the '-l' alias for '--create-reflog' is deprecated;\n> warning: it will be removed in a future version of Git\n> usage: git branch [<options>] [-r | -a] [--merged | --no-merged]\n>    or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]\n>    or: git branch [<options>] [-r] (-d | -D) <branch-name>...\n>    or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>\n>    or: git branch [<options>] (-c | -C) [<old-branch>] <new-branch>\n>    or: git branch [<options>] [-r | -a] [--points-at]\n>    or: git branch [<options>] [-r | -a] [--format]\n> \n> \n> So, the warning message isn't lost. It just prevents the listing of\n> branches.\n\nRight, what I meant by \"gentler\" is that we continue to perform the same\nbehavior as the old version, alongside the warning. It's arguable here\nbecause running \"git branch -l\" has _always_ been wrong. It's just wrong\nin a way that happens to do what the user wants. ;)\n\n> Wait, maybe I'm misunderstanding what you mean by \"warning\". You're\n> probably meaning something related to the way Git exits in both cases.\n> With your patch \"git branch -l\" prints a warning, lists the branches and\n> has an exit status of 0. With my patch it prints the warning, the usage\n> specifications with exit status 128. In that case, I still don't think\n> it's bad to turn \"git branch -l\" into an error now as it's been\n> incorrect for a long time now and it's not wrong if we correct it now.\n> \n> Anyways, if you think it mustn't turn into an error now and only in the\n> next stage, a suggestion follows in another thread.\n\nI don't think \"mustn't\", but I have a slight preference for what I\nposted, as I think it is a little friendlier during the transition (at\nthe risk of somebody missing the warning, but then step 2 turns it into\na hard error anyway, so they'll certainly find out then).\n\n-Peff\n"},{"id":"348724","messageId":"20180529212029.GB7964@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqq1sdzno3g.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:20:29Z","receivedAt":"2018-05-29T21:21:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 26, 2018 at 11:32:35AM +0900, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Yup, thanks for being extra explicit.  I do imagine there are quite\n> > a few of us who would be puzzled without this update (but with the\n> > previous one to unhide it from behind the pager).\n> \n> With these two patches queued on top of jk/branch-l-0-deprecation,\n> the follow-up patches jk/branch-l-1-removal that makes 'branch -l'\n> to fail and then jk/branch-l-2-reincarnation that makes 'branch -l'\n> a synonym to 'branch --list' needs rebasing.  Both are trivial and\n> hopefully I did them correctly.\n> -- >8 --\n> From: Jeff King <peff@peff.net>\n> Date: Mon, 26 Mar 2018 03:29:22 -0400\n> Subject: [PATCH] branch: drop deprecated \"-l\" option\n> \n> We marked the \"-l\" option as deprecated back in <insert sha1\n> here>. Now that sufficient time has passed, let's follow\n> through and get rid of it.\n\nThanks. There's one bit missing here, because it did not cause a textual\nconflict during the rebase (but it's now dead code). Patch below (to be\nsquashed to the tip of jk/branch-l-1-removal).\n\nWe may also want to fill in <insert sha1 here>. I think it's afc968e579\n(branch: deprecate \"-l\" option, 2018-03-26), which should be stable at\nthis point (it's already merged to 'next').\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 01b35b3c3d..f7cd333587 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -34,7 +34,6 @@ static const char * const builtin_branch_usage[] = {\n \tNULL\n };\n \n-static int used_deprecated_reflog_option;\n static const char *head;\n static struct object_id head_oid;\n \n@@ -686,17 +685,6 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n \tif (list)\n \t\tsetup_auto_pager(\"branch\", 1);\n \n-\tif (used_deprecated_reflog_option) {\n-\t\tif (list) {\n-\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n-\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n-\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n-\t\t} else {\n-\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n-\t\t\twarning(\"it will be removed in a future version of Git\");\n-\t\t}\n-\t}\n-\n \tif (delete) {\n \t\tif (!argc)\n \t\t\tdie(_(\"branch name required\"));\n"},{"id":"348725","messageId":"20180529212142.GA8767@sigill.intra.peff.net","threadId":"48510","inReplyTo":"20180529212029.GB7964@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:21:42Z","receivedAt":"2018-05-29T21:22:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, May 29, 2018 at 05:20:29PM -0400, Jeff King wrote:\n\n> Thanks. There's one bit missing here, because it did not cause a textual\n> conflict during the rebase (but it's now dead code). Patch below (to be\n> squashed to the tip of jk/branch-l-1-removal).\n> [...]\n> -\tif (used_deprecated_reflog_option) {\n> -\t\tif (list) {\n> -\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n> -\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n> -\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n> -\t\t} else {\n> -\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> -\t\t\twarning(\"it will be removed in a future version of Git\");\n> -\t\t}\n> -\t}\n> -\n\nOh, and did we want to mark these for translation on the step 0 branch?\nObviously that would impact this hunk.\n\n-Peff\n"},{"id":"348727","messageId":"20180529213244.GD7964@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqqin78jfnl.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:32:45Z","receivedAt":"2018-05-29T21:32:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 28, 2018 at 06:25:18PM +0900, Junio C Hamano wrote:\n\n> Martin Ågren <martin.agren@gmail.com> writes:\n> \n> > diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh\n> > index 0c6f48f302..31b0702e6c 100755\n> > --- a/t/t1011-read-tree-sparse-checkout.sh\n> > +++ b/t/t1011-read-tree-sparse-checkout.sh\n> > @@ -243,9 +243,9 @@ test_expect_success 'print errors when failed to update worktree' '\n> >  \ttest_must_fail git checkout top 2>actual &&\n> >  \tcat >expected <<\\EOF &&\n> >  error: The following untracked working tree files would be overwritten by checkout:\n> > -\tsub/added\n> > -\tsub/addedtoo\n> > -Please move or remove them before you switch branches.\n> > +error: \tsub/added\n> > +error: \tsub/addedtoo\n> > +error: Please move or remove them before you switch branches.\n> >  Aborting\n> >  EOF\n> \n> This shows the typical effect of this series, which (I subjectively\n> think) gives us a more pleasant end-user experience.\n\nHeh, that is one of the cases that I found most ugly when I looked into\nthis earlier (and in particular, because I think it makes cut-and-paste\na little harder).\n\nMore discussion in:\n\n  https://public-inbox.org/git/20170111140758.yyfsc3r3spqpi6es@sigill.intra.peff.net/\n\nand down-thread.\n\n-Peff\n"},{"id":"348728","messageId":"20180529213317.GE7964@sigill.intra.peff.net","threadId":"48510","inReplyTo":"CACsJy8CZQLxU5TPx=M0NV_xTR_9qyjbOWnVcdX9-Tz+BCb24VA@mail.gmail.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:33:17Z","receivedAt":"2018-05-29T21:33:22Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 28, 2018 at 08:40:16PM +0200, Duy Nguyen wrote:\n\n> On Fri, May 25, 2018 at 11:00 PM, Martin Ågren <martin.agren@gmail.com> wrote:\n> > advice.c contains a useful code snippet which takes a multi-line string\n> > and prints the lines, prefixing and suffixing each line with two\n> > constant strings. This was originally added in 23cb5bf3b3 (i18n of\n> > multi-line advice messages, 2011-12-22) to produce such output:\n> >\n> > hint: some multi-line advice\n> > hint: prefixed with \"hint: \"\n> >\n> > The prefix is actually colored after 960786e761 (push: colorize errors,\n> > 2018-04-21) and each line has a suffix for resetting the color.\n> >\n> > The next commit will teach the same \"prefix all the lines\"-trick to the\n> > code that produces, e.g., \"warning: \"-messages. In preparation for that,\n> > extract the code for printing the individual lines and expose it through\n> > git-compat-util.h.\n> >\n> > Signed-off-by: Martin Ågren <martin.agren@gmail.com>\n> > ---\n> > I'm open for suggestions on the naming of `prefix_suffix_lines()`...\n> \n> I think the important verb, print (to FILE*), is somehow missing. This\n> current name would be great if it produces another str(buf).\n\nIt can't use a strbuf, since we want vreportf() to avoid calling any\nallocation functions.\n\n-Peff\n"},{"id":"348729","messageId":"20180529213957.GF7964@sigill.intra.peff.net","threadId":"48510","inReplyTo":"90ac0a41563f070a840076521d8935ad7c21beb9.1527279322.git.martin.agren@gmail.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-29T21:39:57Z","receivedAt":"2018-05-29T21:40:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 25, 2018 at 11:00:53PM +0200, Martin Ågren wrote:\n\n> +/*\n> + * Write the message to the file, prefixing and suffixing\n> + * each line with `prefix` resp. `suffix`.\n> + */\n> +void prefix_suffix_lines(FILE *f, const char *prefix,\n> +\t\t\t const char *message, const char *suffix);\n\nShould this perhaps learn about colors, too?\n\nThat would save us from having to allocate here:\n\n> diff --git a/advice.c b/advice.c\n> index 370a56d054..ffb29e7ef4 100644\n> --- a/advice.c\n> +++ b/advice.c\n> @@ -79,24 +79,22 @@ static struct {\n>  \n>  void advise(const char *advice, ...)\n>  {\n> +\tstruct strbuf prefix = STRBUF_INIT;\n>  \tstruct strbuf buf = STRBUF_INIT;\n>  \tva_list params;\n> -\tconst char *cp, *np;\n> +\n> +\tstrbuf_addf(&prefix, _(\"%shint: \"),\n> +\t\t    advise_get_color(ADVICE_COLOR_HINT));\n\nBut most importantly, it means we could eventually colorize errors, too,\nwhere we are not allowed to allocate.\n\nSo perhaps:\n\n  void report_lines(FILE *out,\n                    const char *color, const char *color_reset,\n\t\t    const char *prefix, const char *msg);\n\nor something?\n\n-Peff\n"},{"id":"348772","messageId":"xmqqfu29gbqp.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180529213957.GF7964@sigill.intra.peff.net","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-30T01:42:38Z","receivedAt":"2018-05-30T01:42:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> But most importantly, it means we could eventually colorize errors, too,\n> where we are not allowed to allocate.\n>\n> So perhaps:\n>\n>   void report_lines(FILE *out,\n>                     const char *color, const char *color_reset,\n> \t\t    const char *prefix, const char *msg);\n>\n> or something?\n\nSounds good to me.  And if you hate the repeated \"error:\" prefix\nthat makes the prefix on the second and subsequent lines included in\ncutting and pasting, we could use the two-prefix idea elsewhere in\nthe thread, too.\n\n"},{"id":"348774","messageId":"xmqq7enlg8ov.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180529212142.GA8767@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-30T02:48:32Z","receivedAt":"2018-05-30T02:48:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> -\t\tif (list) {\n>> -\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n>> -\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n>> -\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n>> -\t\t} else {\n>> -\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n>> -\t\t\twarning(\"it will be removed in a future version of Git\");\n>> -\t\t}\n>> -\t}\n>> -\n>\n> Oh, and did we want to mark these for translation on the step 0 branch?\n> Obviously that would impact this hunk.\n\nI was hoping that we can settle the \"multi-line message translation\nthat can potentially result in different number of lines\" issue\nbefore we have to mark the above for translation ;-)\n"},{"id":"348775","messageId":"xmqqzi0hety4.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180529211523.GA7964@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-30T02:52:19Z","receivedAt":"2018-05-30T02:52:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Right, what I meant by \"gentler\" is that we continue to perform the same\n> behavior as the old version, alongside the warning. It's arguable here\n> because running \"git branch -l\" has _always_ been wrong. It's just wrong\n> in a way that happens to do what the user wants. ;)\n> ...\n>> Anyways, if you think it mustn't turn into an error now and only in the\n>> next stage, a suggestion follows in another thread.\n>\n> I don't think \"mustn't\", but I have a slight preference for what I\n> posted, as I think it is a little friendlier during the transition (at\n> the risk of somebody missing the warning, but then step 2 turns it into\n> a hard error anyway, so they'll certainly find out then).\n\nWell, we could keep treating '-l' given in contexts where we have\nsilently ignored the option and did \"list\" instead as before during\nthe transition, until the very end where it becomes an explicit\n\"list\" command, no?  Then there is no need to even warn against '-l'\nthat is ignored because we are listing in the earliest step.  The\nonly usage that requires a warning then becomes '-l' used for its\noriginal meaning to create a reflog, right?  That sounds gentler to\nme.\n\n"},{"id":"348783","messageId":"xmqq4lipel8a.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"xmqqfu29gbqp.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-05-30T06:00:37Z","receivedAt":"2018-05-30T06:00:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> But most importantly, it means we could eventually colorize errors, too,\n>> where we are not allowed to allocate.\n>>\n>> So perhaps:\n>>\n>>   void report_lines(FILE *out,\n>>                     const char *color, const char *color_reset,\n>> \t\t    const char *prefix, const char *msg);\n>>\n>> or something?\n>\n> Sounds good to me.  And if you hate the repeated \"error:\" prefix\n> that makes the prefix on the second and subsequent lines included in\n> cutting and pasting, we could use the two-prefix idea elsewhere in\n> the thread, too.\n\nIf we do not want duplicate prefix, another approach is to leave\neverything including alignment up to the translators.  For example,\n\n        error(_(\"the first line of error.\\n\"\n                \"       ... and the second.\"));\n\ncould be a valid way to produce\n\n        error: the first line of error.\n               ... and the second.\n\non the display, and get it translated to\n\n        ERRORX: THE FIRST LINE OF ERROR.\n                ... AND THE SECOND.\n\nwith these entries for that hypothetical \"shout in caps\" language.\n\n        msgid \"error: \"\n        msgstr \"ERRORX: \"\n        msgid \"the first line of error.\\n       ... and the second.\"\n        msgstr\"THE FIRST LINE OF ERROR.\\n        ... AND THE SECOND.\"\n\nSo I do not think the two-prefix idea is necessary (and if people\nprefer to have repeated prefix, that can also be done perfectly well\nwithin this scheme---the second and subsequent message needs to\nduplicate \"error:\" at the beginning, which is sort of ugly, but the\nleading spaces for alignment we see above already knows how wide\n\"error:\" and its translation is, so it is not that much worse\nanyway).\n\nBut still, your suggestion to allow color/reset so that we can do\nwithout extra allocation is a good idea.\n"},{"id":"348798","messageId":"CAN0heSoeuSDyeJ0sFgYo689AaHfj4q0SC5bJt4cpv2TeQX5uVA@mail.gmail.com","threadId":"48510","inReplyTo":"CACsJy8C-BT158DW_Tz24ea_QUfQHQpToCC-=E+-zZeZeAD9heQ@mail.gmail.com","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-30T10:19:36Z","receivedAt":"2018-05-30T10:19:41Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 29 May 2018 at 17:50, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Tue, May 29, 2018 at 6:49 AM, Martin Ågren <martin.agren@gmail.com> wrote:\n>> On 28 May 2018 at 23:45, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Duy Nguyen <pclouds@gmail.com> writes:\n>>>\n>>>>>> +error:       sub/added\n>>>>>> +error:       sub/addedtoo\n>>>>>> +error: Please move or remove them before you switch branches.\n>>>>>>  Aborting\n>>>>>>  EOF\n>>>>>\n>>>>> This shows the typical effect of this series, which (I subjectively\n>>>>> think) gives us a more pleasant end-user experience.\n>>>>\n>>>> Also, very subjectively, I'm torn about this. To me, just one\n>>>> \"error/warning/fatal\" at the start of the first paragraph feels much\n>>>> better. If we have to somehow mark the second paragraph that \"this is\n>>>> also part of the error message\" then it's probably better to rephrase.\n>>\n>> Would you feel the same about \"hint: \"? We already do prefix all the\n>> lines there. It seems to we we should probably do the same for \"hint: \"\n>> as for \"warning: \", whatever we decide is right.\n>\n> It may depend on context. Let's look at the commit that introduces\n> this \"hint:\" prefix, 38ef61cfde (advice: Introduce\n> error_resolve_conflict - 2011-08-04). The example in the commit\n> message shows the hint paragraph sandwiched by an error and a fatal\n> one:\n>\n>       error: 'commit' is not possible because you have unmerged files.\n>       hint: Fix them up in the work tree ...\n>       hint: ...\n>       fatal: Exiting because of an unresolved conflict.\n>\n> I think in this case (dense paragraphs of different message types) yes\n> it might make sense to prefix lines with \"hint:\". But when there's\n> only one type of message like the \"error\" part quoted at the top, it\n> feels too verbose to have error: prefix everywhere.\n\nHmm, that's interesting. Deciding based on what has already been output\nseems feasible, although it sounds like the potential target of infinite\ntweaking of some central logic for deciding which way to go. Or, lots of\nvarious places to try and make consistent. I am tempted towards\nindenting with spaces in v2, and to leave \"hint: \" alone as an outlier.\n(It always was one. :-/ ) I'll keep your feedback in mind.\n\nThanks,\nMartin\n"},{"id":"348799","messageId":"CAN0heSoSYZaui5xSaJ=FGMjAFyhRWDCmGH=hXo0VCRf8RSqNHA@mail.gmail.com","threadId":"48510","inReplyTo":"20180529213244.GD7964@sigill.intra.peff.net","subject":"Re: [RFC PATCH 2/3] usage: prefix all lines in `vreportf()`, not just the first","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-30T10:20:14Z","receivedAt":"2018-05-30T10:20:18Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 29 May 2018 at 23:32, Jeff King <peff@peff.net> wrote:\n> On Mon, May 28, 2018 at 06:25:18PM +0900, Junio C Hamano wrote:\n>\n>> This shows the typical effect of this series, which (I subjectively\n>> think) gives us a more pleasant end-user experience.\n>\n> Heh, that is one of the cases that I found most ugly when I looked into\n> this earlier (and in particular, because I think it makes cut-and-paste\n> a little harder).\n>\n> More discussion in:\n>\n>   https://public-inbox.org/git/20170111140758.yyfsc3r3spqpi6es@sigill.intra.peff.net/\n>\n> and down-thread.\n\nThanks for the pointer. I had missed that thread entirely.\n\nMartin\n"},{"id":"348800","messageId":"CAN0heSqmhaKrxYSUKWcxWFR0QwZPOG9kueBPJv6jnMNJpb+aMA@mail.gmail.com","threadId":"48510","inReplyTo":"xmqq4lipel8a.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Martin Ågren","fromEmail":"martin.agren@gmail.com","sentAt":"2018-05-30T10:26:40Z","receivedAt":"2018-05-30T10:26:44Z","isPatch":true,"sender":{"key":"martin.agren@gmail.com","avatar":null},"body":"On 30 May 2018 at 08:00, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Jeff King <peff@peff.net> writes:\n>>\n>>> But most importantly, it means we could eventually colorize errors, too,\n>>> where we are not allowed to allocate.\n>>>\n>>> So perhaps:\n>>>\n>>>   void report_lines(FILE *out,\n>>>                     const char *color, const char *color_reset,\n>>>                  const char *prefix, const char *msg);\n>>>\n>>> or something?\n>>\n>> Sounds good to me.  And if you hate the repeated \"error:\" prefix\n>> that makes the prefix on the second and subsequent lines included in\n>> cutting and pasting, we could use the two-prefix idea elsewhere in\n>> the thread, too.\n\n(That also gets rid of the minor strangeness of my series to introduce an\noverly broad `suffix` and use it only for resetting color, not actually\nfor giving any textual suffix.)\n\n> If we do not want duplicate prefix, another approach is to leave\n> everything including alignment up to the translators.  For example,\n>\n>         error(_(\"the first line of error.\\n\"\n>                 \"       ... and the second.\"));\n>\n[...]\n> with these entries for that hypothetical \"shout in caps\" language.\n>\n>         msgid \"error: \"\n>         msgstr \"ERRORX: \"\n>         msgid \"the first line of error.\\n       ... and the second.\"\n>         msgstr\"THE FIRST LINE OF ERROR.\\n        ... AND THE SECOND.\"\n>\n> So I do not think the two-prefix idea is necessary (and if people\n> prefer to have repeated prefix, that can also be done perfectly well\n> within this scheme---the second and subsequent message needs to\n> duplicate \"error:\" at the beginning, which is sort of ugly, but the\n> leading spaces for alignment we see above already knows how wide\n> \"error:\" and its translation is, so it is not that much worse\n> anyway).\n\nThanks for lots of good input. Doing the indenting in the error does\nmean that to indent properly, the translator needs to know that it is an\nerror, and not a warning. Or one could say that they would need to know\nthe amount of indentation anyway so that they can know where to wrap\noptimally.\n\nAnother consequence is that if we can emit a certain string as either,\ne.g., a warning or an error depending on the context, we need to address\nthat. Using contexts, of course. Thank you for the hint about that. (I\nhave not checked if we actually have such \"this is a warning or an\nerror\"-strings currently.)\n\nSomehow it feels slightly cleaner to me, at least on first thought, to\ntry to decouple the indenting from the translating and line-wrapping.\nBut as noted above, the indenting does affect how the line-wrapping\nshould/may be done.\n\nI won't have as much time as I'd like for tinkering with this the next\nweek, or even weeks. Hopefully when I do get around to it, I will have\nprocessed all the very good input I have received and turn that into\nsomething good.\n\nThanks,\nMartin\n"},{"id":"348869","messageId":"20180531054451.GB17344@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqq7enlg8ov.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-31T05:44:52Z","receivedAt":"2018-05-31T05:44:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 30, 2018 at 11:48:32AM +0900, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> >> -\t\tif (list) {\n> >> -\t\t\twarning(\"the '-l' option is an alias for '--create-reflog' and\");\n> >> -\t\t\twarning(\"has no effect in list mode. This option will soon be\");\n> >> -\t\t\twarning(\"removed and you should omit it (or use '--list' instead).\");\n> >> -\t\t} else {\n> >> -\t\t\twarning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> >> -\t\t\twarning(\"it will be removed in a future version of Git\");\n> >> -\t\t}\n> >> -\t}\n> >> -\n> >\n> > Oh, and did we want to mark these for translation on the step 0 branch?\n> > Obviously that would impact this hunk.\n> \n> I was hoping that we can settle the \"multi-line message translation\n> that can potentially result in different number of lines\" issue\n> before we have to mark the above for translation ;-)\n\nYeah, right after saying that I realized it would create horrible\ntranslation-lego. I agree we should punt for now.\n\n-Peff\n"},{"id":"348870","messageId":"20180531055100.GC17344@sigill.intra.peff.net","threadId":"48510","inReplyTo":"xmqqzi0hety4.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-31T05:51:00Z","receivedAt":"2018-05-31T05:51:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 30, 2018 at 11:52:19AM +0900, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Right, what I meant by \"gentler\" is that we continue to perform the same\n> > behavior as the old version, alongside the warning. It's arguable here\n> > because running \"git branch -l\" has _always_ been wrong. It's just wrong\n> > in a way that happens to do what the user wants. ;)\n> > ...\n> >> Anyways, if you think it mustn't turn into an error now and only in the\n> >> next stage, a suggestion follows in another thread.\n> >\n> > I don't think \"mustn't\", but I have a slight preference for what I\n> > posted, as I think it is a little friendlier during the transition (at\n> > the risk of somebody missing the warning, but then step 2 turns it into\n> > a hard error anyway, so they'll certainly find out then).\n> \n> Well, we could keep treating '-l' given in contexts where we have\n> silently ignored the option and did \"list\" instead as before during\n> the transition, until the very end where it becomes an explicit\n> \"list\" command, no?  Then there is no need to even warn against '-l'\n> that is ignored because we are listing in the earliest step.  The\n> only usage that requires a warning then becomes '-l' used for its\n> original meaning to create a reflog, right?  That sounds gentler to\n> me.\n\nSo I think you're proposing:\n\n  - step 0: warn about \"-l\" when it actually gets used, and otherwise\n    continue ignoring\n\n  - step 1: turn \"-l\" into \"--list\"\n\n  - step 2: there is no step 2\n\nI can't think of any reason that would work, and it lets us reclaim it\nfor \"--list\" sooner. I guess \"when it gets used\" is maybe not the right\ncriterion. We'd warn on:\n\n  git branch -l foo\n\nBut we wouldn't on:\n\n  git branch -d -l foo\n\nThat's clearly nonsense, but we're probably better off complaining. So I\nguess the right rule is to warn when we are not in list-mode, and\notherwise quietly accept it.\n\nThat does mean that anybody who misses the deprecation warning may be\nsurprised when \"branch -l foo\" starts listing instead of creating a\nbranch with a reflog (whereas in the current 3-step plan, we have a\nperiod in the middle where that's a hard error). That may be OK, though,\nand is a natural consequence of getting to the end step sooner (even\nwith a 3-step plan, anybody who skips the versions in the middle _could_\nbe surprised).\n\n-Peff\n"},{"id":"348871","messageId":"2d9c365e-4a04-6a25-b942-c7d1db960002@gmail.com","threadId":"48510","inReplyTo":"xmqqzi0hety4.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Kaartic.Sivaraam","fromEmail":"kaartic.sivaraam@gmail.com","sentAt":"2018-05-31T05:52:40Z","receivedAt":"2018-05-31T05:53:18Z","isPatch":true,"sender":{"key":"kaartic.sivaraam@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12448084?v=4"},"body":"On Wednesday 30 May 2018 08:22 AM, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> \n>> Right, what I meant by \"gentler\" is that we continue to perform the same\n>> behavior as the old version, alongside the warning. It's arguable here\n>> because running \"git branch -l\" has _always_ been wrong. It's just wrong\n>> in a way that happens to do what the user wants. ;)\n>> ...\n>>> Anyways, if you think it mustn't turn into an error now and only in the\n>>> next stage, a suggestion follows in another thread.\n>>\n>> I don't think \"mustn't\", but I have a slight preference for what I\n>> posted, as I think it is a little friendlier during the transition (at\n>> the risk of somebody missing the warning, but then step 2 turns it into\n>> a hard error anyway, so they'll certainly find out then).\n> \n> Well, we could keep treating '-l' given in contexts where we have\n> silently ignored the option and did \"list\" instead as before during\n> the transition, until the very end where it becomes an explicit\n> \"list\" command, no?  Then there is no need to even warn against '-l'\n> that is ignored because we are listing in the earliest step.  The\n> only usage that requires a warning then becomes '-l' used for its\n> original meaning to create a reflog, right?  That sounds gentler to\n> me.\n> \n\nThat sounds interesting. I guess that would avoid the confusion I was \nspeaking of from the beginning of this thread as the warning message \nwould not be shown at all for \"git branch -l\". Of course, it would then \nconfuse people who discover that \"git branch -l\" lists and \"git branch \n-l $prefix\" creates a branch with name \"$prefix\" (if it's valid) instead \nof listing branch names with prefix \"$prefix\". So, it might be worth \nconsidering.\n\nBTW, I suspect this would make the deprecation of \"-l\" a little unsual \nas the no. of people who see the deprecation warning would be less as \nthe warning is shown only for \"git branch -l $branch\" and I also suspect \nthe no. of users of that command would be very less as previously \npointed by someone elsewhere.\n\n--\nSivaraam\n"},{"id":"348874","messageId":"20180531060738.GF17344@sigill.intra.peff.net","threadId":"48510","inReplyTo":"CAN0heSqmhaKrxYSUKWcxWFR0QwZPOG9kueBPJv6jnMNJpb+aMA@mail.gmail.com","subject":"Re: [RFC PATCH 1/3] usage: extract `prefix_suffix_lines()` from `advise()`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-05-31T06:07:38Z","receivedAt":"2018-05-31T06:07:42Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 30, 2018 at 12:26:40PM +0200, Martin Ågren wrote:\n\n> >>> So perhaps:\n> >>>\n> >>>   void report_lines(FILE *out,\n> >>>                     const char *color, const char *color_reset,\n> >>>                  const char *prefix, const char *msg);\n> >>>\n> >>> or something?\n> >>\n> >> Sounds good to me.  And if you hate the repeated \"error:\" prefix\n> >> that makes the prefix on the second and subsequent lines included in\n> >> cutting and pasting, we could use the two-prefix idea elsewhere in\n> >> the thread, too.\n> \n> (That also gets rid of the minor strangeness of my series to introduce an\n> overly broad `suffix` and use it only for resetting color, not actually\n> for giving any textual suffix.)\n\nYeah, that \"suffix\" argument left me scratching my head at first. :)\n\n> Somehow it feels slightly cleaner to me, at least on first thought, to\n> try to decouple the indenting from the translating and line-wrapping.\n> But as noted above, the indenting does affect how the line-wrapping\n> should/may be done.\n\nYeah, agreed. Once report_lines() (or whatever we call it) knows what\nthe prefix is, it is capable of handling indentation on its own either\nby repeating the prefix or by computing its visual width and outputting\nappropriate spaces (which we can probably never get perfect without\nknowing about the terminal, but we could at least make an approximation,\nor even use some ANSI magic -- we could even make it run-time\nconfigurable, though I'm not sure anybody would care that much).\n\n-Peff\n"},{"id":"348956","messageId":"xmqq8t7zb865.fsf@gitster-ct.c.googlers.com","threadId":"48510","inReplyTo":"20180531055100.GC17344@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-06-01T01:35:30Z","receivedAt":"2018-06-01T01:35:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> So I think you're proposing:\n>\n>   - step 0: warn about \"-l\" when it actually gets used, and otherwise\n>     continue ignoring\n>\n>   - step 1: turn \"-l\" into \"--list\"\n>\n>   - step 2: there is no step 2\n>\n> ... So I\n> guess the right rule is to warn when we are not in list-mode, and\n> otherwise quietly accept it.\n>\n> That does mean that anybody who misses the deprecation warning may be\n> surprised when \"branch -l foo\" starts listing instead of creating a\n> branch with a reflog (whereas in the current 3-step plan, we have a\n> period in the middle where that's a hard error). That may be OK, though,\n> and is a natural consequence of getting to the end step sooner (even\n> with a 3-step plan, anybody who skips the versions in the middle _could_\n> be surprised).\n\nThanks for a concise and readably summary ;-)\n"},{"id":"349067","messageId":"CACsJy8AfCiJad8GD2xAWFp7WVFXZtZrqtE91awe0VS5Ni71rSw@mail.gmail.com","threadId":"48510","inReplyTo":"20180525024002.GA1998@sigill.intra.peff.net","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-06-02T04:46:31Z","receivedAt":"2018-06-02T04:47:06Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, May 25, 2018 at 4:40 AM, Jeff King <peff@peff.net> wrote:\n> -- >8 --\n> Subject: [PATCH] branch: customize \"-l\" warning in list mode\n>\n> People mistakenly use \"git branch -l\", thinking that it\n> triggers list mode. It doesn't, but the lack of non-option\n> arguments in that command does (and the \"-l\" becomes a\n> silent noop).\n>\n> Since afc968e579 (branch: deprecate \"-l\" option, 2018-03-26)\n> we've warned that \"-l\" is going away. But the warning text\n> is primarily aimed at people who _meant_ to use \"-l\", as in\n> \"git branch -l foo\". People who mistakenly said \"git branch\n> -l\" may be left puzzled.\n>\n> Let's make it clear that:\n>\n>   1. No, \"-l\" didn't do what they thought here.\n>\n>   2. It's going away, and what they should do instead.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n>  builtin/branch.c | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n>\n> diff --git a/builtin/branch.c b/builtin/branch.c\n> index 55bfacd843..b0b33dab94 100644\n> --- a/builtin/branch.c\n> +++ b/builtin/branch.c\n> @@ -701,8 +701,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)\n>                 setup_auto_pager(\"branch\", 1);\n>\n>         if (used_deprecated_reflog_option) {\n> -               warning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> -               warning(\"it will be removed in a future version of Git\");\n> +               if (list) {\n> +                       warning(\"the '-l' option is an alias for '--create-reflog' and\");\n> +                       warning(\"has no effect in list mode. This option will soon be\");\n> +                       warning(\"removed and you should omit it (or use '--list' instead).\");\n> +               } else {\n> +                       warning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> +                       warning(\"it will be removed in a future version of Git\");\n> +               }\n\nThis is already in 'next', but could you do a follow up patch to mark\nthese strings for translation? While at there, concatenating them into\nfull sentences would also help translators.\n\n>         }\n>\n>         if (delete) {\n> --\n> 2.17.0.1391.g6fdbf40724\n>\n\n\n\n-- \nDuy\n"},{"id":"349074","messageId":"20180602081044.GA699@sigill.intra.peff.net","threadId":"48510","inReplyTo":"CACsJy8AfCiJad8GD2xAWFp7WVFXZtZrqtE91awe0VS5Ni71rSw@mail.gmail.com","subject":"Re: [PATCH] branch: issue \"-l\" deprecation warning after pager starts","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-06-02T08:10:45Z","receivedAt":"2018-06-02T08:10:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jun 02, 2018 at 06:46:31AM +0200, Duy Nguyen wrote:\n\n> >         if (used_deprecated_reflog_option) {\n> > -               warning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> > -               warning(\"it will be removed in a future version of Git\");\n> > +               if (list) {\n> > +                       warning(\"the '-l' option is an alias for '--create-reflog' and\");\n> > +                       warning(\"has no effect in list mode. This option will soon be\");\n> > +                       warning(\"removed and you should omit it (or use '--list' instead).\");\n> > +               } else {\n> > +                       warning(\"the '-l' alias for '--create-reflog' is deprecated;\");\n> > +                       warning(\"it will be removed in a future version of Git\");\n> > +               }\n> \n> This is already in 'next', but could you do a follow up patch to mark\n> these strings for translation? While at there, concatenating them into\n> full sentences would also help translators.\n\nAlready being discussed elsewhere on the thread; we're hoping for a\nwarning() that will auto-prefix each one.\n\nThat said, I think I'm going to re-roll this in the direction discussed\nelsewhere in the thread (skipping the warning for list-mode).\n\n-Peff\n"},{"id":"349673","messageId":"CA+P7+xqHejWOc=2v_OsJn8T-pUthxDgXWcLV1mbaSsRw1_iVTA@mail.gmail.com","threadId":"48510","inReplyTo":"20180517194653.48928-1-sbeller@google.com","subject":"Re: [PATCH 0/8] Reroll of sb/diff-color-move-more","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2018-06-07T23:54:32Z","receivedAt":"2018-06-07T23:54:57Z","isPatch":true,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Thu, May 17, 2018 at 12:46 PM, Stefan Beller <sbeller@google.com> wrote:\n>>> * sb/diff-color-move-more (2018-04-25) 7 commits\n>>...\n>>>\n>>>  Will merge to 'next'.\n>>\n>>I did not get around to fix it up, there are still review\n>>comments outstanding. (The test is broken in the last commit.)\n>\n> This is a reroll of sb/diff-color-move-more, with the test fixed as well\n> as another extra patch, that would have caught the bad test.\n>\n> The range diff is below.\n>\n> Thanks,\n> Stefan\n>\n> Stefan Beller (8):\n>   xdiff/xdiff.h: remove unused flags\n>   xdiff/xdiffi.c: remove unneeded function declarations\n>   diff.c: do not pass diff options as keydata to hashmap\n>   diff.c: adjust hash function signature to match hashmap expectation\n>   diff.c: add a blocks mode for moved code detection\n>   diff.c: decouple white space treatment from move detection algorithm\n>   diff.c: add --color-moved-ignore-space-delta option\n>   diff: color-moved white space handling options imply color-moved\n>\n\nI've been using this locally, and it's really nice. One question I\nhad, are there plans to make the whitespace options configurable? I\nreally like the option for enabling lines to count as moved when the\nwhitespace changes uniformly, (it helps make changes more obvious when\ndoing indentation changes such as wrapping code within a block).\nHowever, it's rather a long option name to type out. I didn't see any\nobvious config options to enable it by default though.\n\nThanks,\nJake\n"},{"id":"357527","messageId":"87tvn2remn.fsf@evledraar.gmail.com","threadId":"48510","inReplyTo":"CAGZ79kae4k=uLx-oX5emxas4KrqObzQhzgir0coOSBzzpO8APw@mail.gmail.com","subject":"Re: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-09-06T12:31:44Z","receivedAt":"2018-09-06T12:31:55Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, May 25 2018, Stefan Beller wrote:\n\n> On Fri, May 25, 2018 at 5:28 AM, Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>>\n>> On Thu, May 17 2018, Junio C Hamano wrote:\n>>\n>>> * sb/submodule-move-nested (2018-03-29) 6 commits\n>>>   (merged to 'next' on 2018-04-25 at 86b177433a)\n>>>  + submodule: fixup nested submodules after moving the submodule\n>>>  + submodule-config: remove submodule_from_cache\n>>>  + submodule-config: add repository argument to submodule_from_{name, path}\n>>>  + submodule-config: allow submodule_free to handle arbitrary repositories\n>>>  + grep: remove \"repo\" arg from non-supporting funcs\n>>>  + submodule.h: drop declaration of connect_work_tree_and_git_dir\n>>>\n>>>  Moving a submodule that itself has submodule in it with \"git mv\"\n>>>  forgot to make necessary adjustment to the nested sub-submodules;\n>>>  now the codepath learned to recurse into the submodules.\n>>\n>> I didn't spot this earlier because I don't test this a lot, but I've\n>> bisected the following breakage down to da62f786d2 (\"submodule: fixup\n>> nested submodules after moving the submodule\", 2018-03-28) (and manually\n>> confirmed by reverting). On Linux both Debian & CentOS I get tests 3 and\n>> 4 failing with:\n>>\n>>      GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n>>\n>> -v -x output follows:\n>>\n>> expecting success:\n>>         mkdir submodule &&\n>>         (cd submodule &&\n>>                 git init &&\n>>                 echo a >a &&\n>>                 git add . &&\n>>                 git commit -ma\n>>         ) &&\n>>         mkdir super &&\n>>         (cd super &&\n>>                 git init &&\n>>                 git submodule add ../submodule &&\n>>                 git submodule add ../submodule a &&\n>>                 git commit -m \"add as submodule and as a\" &&\n>>                 git mv a b &&\n>>                 git commit -m \"move a to b\"\n>>         )\n>\n> when you add a test_pause here and dump the\n> state of the setup, then it can be observed that when the fsmonitor is active\n> the last commit is different; without fsmonitor the moved gitlink and the change\n> to the .gitmodules file is part of the commit, i.e.\n>\n> $ git -C super show\n>         commit d3d90b70a01bd17d026f75a803c8b65f5903a7c0 (HEAD -> master)\n>         Author: A U Thor <author@example.com>\n>         Date:   Fri May 25 19:21:58 2018 +0000\n>\n>             move a to b\n>\n>         diff --git a/.gitmodules b/.gitmodules\n>         index 3f4d474..6149210 100644\n>         --- a/.gitmodules\n>         +++ b/.gitmodules\n>         @@ -2,5 +2,5 @@\n>           path = submodule\n>           url = ../submodule\n>          [submodule \"a\"]\n>         - path = a\n>         + path = b\n>           url = ../submodule\n>         diff --git a/a b/b\n>         similarity index 100%\n>         rename from a\n>         rename to b\n> When running with the fsmonitor:\n>\n> $ git -C super show\n>         commit 57022a92acf46f303498c045440ec099cbc35a2d (HEAD -> master)\n>         Author: A U Thor <author@example.com>\n>         Date:   Fri May 25 19:22:52 2018 +0000\n>\n>             move a to b\n>\n>         diff --git a/a b/b\n>         similarity index 100%\n>         rename from a\n>         rename to b\n> $ git -C super diff\n>         diff --git a/.gitmodules b/.gitmodules\n>         index 3f4d474..6149210 100644\n>         --- a/.gitmodules\n>         +++ b/.gitmodules\n>         @@ -2,5 +2,5 @@\n>           path = submodule\n>           url = ../submodule\n>          [submodule \"a\"]\n>         - path = a\n>         + path = b\n>           url = ../submodule\n>\n> This hints at a problem with git commit;\n>\n> I tried adding test_tick, to unconfuse the fsmonitor, but that doesn't help,\n> digging further, the problem is in the git mv command, which fails to\n> add the change in\n> .gitmodules to the index.\n>\n> Adding the verbose flag to stage_updated_gitmodules() that is called by\n> git-mv very late in the game, such that\n>\n> void stage_updated_gitmodules(struct index_state *istate)\n> {\n>     trace_printf(\"staging .gitmodules files\");\n>     if (add_file_to_index(istate, GITMODULES_FILE, ADD_CACHE_VERBOSE))\n>         die(_(\"staging updated .gitmodules failed\"));\n> }\n>\n> We would get a message if the .gitmodules file is staged correctly, as\n> add_file_to_index() that calls add_to_index that would print\n>\n>     if (verbose && !was_same)\n>         printf(\"add '%s'\\n\", path);\n>\n> I could not see that message, so I suspect, that there is something\n> racy.\n>\n> Will debug further.\n\nI spotted this again after testing the split index (see\nhttps://public-inbox.org/git/87va7ireuu.fsf@evledraar.gmail.com/) and\nwas testing the fsmonitor test mode as well.\n\nSo gentle *poke*: Did you get anywhere with debugging this? It's still\nfailing on \"master\" now.\n"},{"id":"357548","messageId":"CAGZ79kYKzrRXy+GUCpMN3jpo4MvcpGvBFvEkTjrsy85XJb0K2A@mail.gmail.com","threadId":"48510","inReplyTo":"87tvn2remn.fsf@evledraar.gmail.com","subject":"Re: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-06T16:57:05Z","receivedAt":"2018-09-06T16:57:20Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"> > Will debug further.\n>\n> I spotted this again after testing the split index (see\n> https://public-inbox.org/git/87va7ireuu.fsf@evledraar.gmail.com/) and\n> was testing the fsmonitor test mode as well.\n>\n> So gentle *poke*: Did you get anywhere with debugging this? It's still\n> failing on \"master\" now.\n\nI started looking into this again, help would be appreciated, as I do not\nquite understand the fsmonitor part.\n\nThe error is in the setup, where we have \"git mv a b\"\n\nGIT_TRACE_FSMONITOR=1 GIT_TRACE=1\nGIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all\n./t7411-submodule-config.sh -d -i -v -x\n++ git mv a b\ntrace: built-in: git mv a b\nread fsmonitor extension successful\nadd fsmonitor\nrefresh fsmonitor\ntrace: run_command: cd '/u/git/t/trash\ndirectory.t7411-submodule-config/super'; /u/git/t/t7519/fsmonitor-all\n1 1536252819824793728\nfsmonitor process '/u/git/t/t7519/fsmonitor-all' returned success\nmark_fsmonitor_clean '.gitmodules'\nwrite fsmonitor extension successful\n\nor with more trace_printfs littered through the code\n(https://github.com/stefanbeller/git/tree/submodule_fsmoitor_debug)\n\ntrace: built-in: git mv a b\nread fsmonitor extension successful\nadd fsmonitor\nrefresh fsmonitor\ntrace: run_command: cd '/u/git/t/trash\ndirectory.t7411-submodule-config/super'; /u/git/t/t7519/fsmonitor-all\n1 1536252497951329341\nfsmonitor process '/u/git/t/t7519/fsmonitor-all' returned success\nneed to stage .gitmodules\ncalling add_file_to_index\n\n\nI suspect that the FSMONITOR API is handled wrongly by the part of git-mv\nthat writes out the .gitmodules file (if needed) and the .git/index (as needed).\n\nBen, do you have an idea?\n\nThanks,\nStefan\n"},{"id":"357561","messageId":"MW2PR2101MB0970C7744A6FA72940DCB252F4010@MW2PR2101MB0970.namprd21.prod.outlook.com","threadId":"48510","inReplyTo":"CAGZ79kYKzrRXy+GUCpMN3jpo4MvcpGvBFvEkTjrsy85XJb0K2A@mail.gmail.com","subject":"RE: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-09-06T19:03:06Z","receivedAt":"2018-09-06T19:03:14Z","isPatch":false,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> -----Original Message-----\n> From: Stefan Beller <sbeller@google.com>\n> Sent: Thursday, September 6, 2018 12:57 PM\n> To: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Cc: Junio C Hamano <gitster@pobox.com>; git <git@vger.kernel.org>; Ben\n> Peart <Ben.Peart@microsoft.com>\n> Subject: Re: sb/submodule-move-nested breaks t7411 under\n> GIT_FSMONITOR_TEST\n> \n> > > Will debug further.\n> >\n> > I spotted this again after testing the split index (see\n> >\n> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpublic-\n> inbox.org%2Fgit%2F87va7ireuu.fsf%40evledraar.gmail.com%2F&amp;data=0\n> 2%7C01%7CBen.Peart%40microsoft.com%7C27c901f198a24e5a045a08d6141\n> 9ce42%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636718498401\n> 788697&amp;sdata=JfavHtKafiJRAVnvMXU3nw1RI27G4OFxs3Ymt7STbvM%3\n> D&amp;reserved=0) and\n> > was testing the fsmonitor test mode as well.\n> >\n> > So gentle *poke*: Did you get anywhere with debugging this? It's still\n> > failing on \"master\" now.\n> \n> I started looking into this again, help would be appreciated, as I do not\n> quite understand the fsmonitor part.\n> \n> The error is in the setup, where we have \"git mv a b\"\n> \n> GIT_TRACE_FSMONITOR=1 GIT_TRACE=1\n> GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all\n> ./t7411-submodule-config.sh -d -i -v -x\n> ++ git mv a b\n> trace: built-in: git mv a b\n> read fsmonitor extension successful\n> add fsmonitor\n> refresh fsmonitor\n> trace: run_command: cd '/u/git/t/trash\n> directory.t7411-submodule-config/super'; /u/git/t/t7519/fsmonitor-all\n> 1 1536252819824793728\n> fsmonitor process '/u/git/t/t7519/fsmonitor-all' returned success\n> mark_fsmonitor_clean '.gitmodules'\n> write fsmonitor extension successful\n> \n> or with more trace_printfs littered through the code\n> (https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub\n> .com%2Fstefanbeller%2Fgit%2Ftree%2Fsubmodule_fsmoitor_debug&amp;d\n> ata=02%7C01%7CBen.Peart%40microsoft.com%7C27c901f198a24e5a045a08\n> d61419ce42%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6367184\n> 98401788697&amp;sdata=poAUFlVDkoNP56t1hmdxHHyChrH05cut1iSVt70yJ\n> eo%3D&amp;reserved=0)\n> \n> trace: built-in: git mv a b\n> read fsmonitor extension successful\n> add fsmonitor\n> refresh fsmonitor\n> trace: run_command: cd '/u/git/t/trash\n> directory.t7411-submodule-config/super'; /u/git/t/t7519/fsmonitor-all\n> 1 1536252497951329341\n> fsmonitor process '/u/git/t/t7519/fsmonitor-all' returned success\n> need to stage .gitmodules\n> calling add_file_to_index\n> \n> \n> I suspect that the FSMONITOR API is handled wrongly by the part of git-mv\n> that writes out the .gitmodules file (if needed) and the .git/index (as needed).\n> \n> Ben, do you have an idea?\n> \n\nI'll take a look as soon as I can (and at the other fsmonitor test issue Ævar sent email about) but it may be a few days before I get a chance.\n\nI haven't had a chance to look into this yet but here are a couple of SWAG's I'd start with:\n\nI wonder if there is a missing call to mark_fsmonitor_invalid() in the \"git mv\" codepath somewhere.\n\nrefresh_fsmonitor() only runs once per git command - is it possible that \"git mv\" is triggering it early, making a change, and then updating the index with stale fsmonitor data?\n\nSorry, I'll look as soon as I can.\n\nBen\n\n> Thanks,\n> Stefan\n"},{"id":"357573","messageId":"CAGZ79kY_+jNAu4jwVOhd+gVMELDSjk_MACKBRf51tksrzZMx-A@mail.gmail.com","threadId":"48510","inReplyTo":"MW2PR2101MB0970C7744A6FA72940DCB252F4010@MW2PR2101MB0970.namprd21.prod.outlook.com","subject":"Re: sb/submodule-move-nested breaks t7411 under GIT_FSMONITOR_TEST","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-06T20:14:55Z","receivedAt":"2018-09-06T20:15:10Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"> > Ben, do you have an idea?\n> >\n>\n> I'll take a look as soon as I can (and at the other fsmonitor test issue Ævar sent email about) but it may be a few days before I get a chance.\n>\n> I haven't had a chance to look into this yet but here are a couple of SWAG's I'd start with:\n>\n\n> is it possible that \"git mv\" is triggering it early, making a change, and then updating the index with stale fsmonitor data?\n\nThis is exactly what is happening. Thanks for describing the situation\nprecisely.\n\n> I wonder if there is a missing call to mark_fsmonitor_invalid() in the \"git mv\" codepath somewhere.\n>\n> refresh_fsmonitor() only runs once per git command\n\nJust naively adding mark_fsmonitor_invalid doesn't work, as then\nwe have a sequence of\n\nfsmonitor process '/u/git/t/t7519/fsmonitor-all' returned success\nmark_fsmonitor_clean '.gitmodules'\nmark_fsmonitor_invalid '.gitmodules'\nwrite fsmonitor extension successful\n\nand the marking invalid doesn't seem to override the first\nmark as valid ?\n\n>\n> Sorry, I'll look as soon as I can.\n>\n> Ben\n\nThanks!\nStefan\n"},{"id":"357574","messageId":"20180906203444.162213-1-sbeller@google.com","threadId":"48510","inReplyTo":"CAGZ79kY_+jNAu4jwVOhd+gVMELDSjk_MACKBRf51tksrzZMx-A@mail.gmail.com","subject":"[PATCH] git-mv: allow submodules and fsmonitor to work together","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-06T20:34:44Z","receivedAt":"2018-09-06T20:34:51Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"It was reported that\n\n  GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n\nbreaks as the .gitmodules file is modified and staged after the fsmonitor\nconsiders it clean. Mark the .gitmodules file to be not clean before\nstaging.\n\nReported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nInspired-by: Ben Peart <benpeart@microsoft.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n\nI am not quite sure if this is the correct approach and handling of the\nfsmonitor API, but it unbreaks the test.\n\n> Just naively adding mark_fsmonitor_invalid doesn't work, as then ...\n\nAdding it before the staging, works.\n\nPlease double check!\n\nThanks,\nStefan\n\n submodule.c | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/submodule.c b/submodule.c\nindex 50cbf5f13ed..56b0d5fe24e 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -22,6 +22,7 @@\n #include \"worktree.h\"\n #include \"parse-options.h\"\n #include \"object-store.h\"\n+#include \"fsmonitor.h\"\n \n static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;\n static struct string_list changed_submodule_names = STRING_LIST_INIT_DUP;\n@@ -149,6 +150,15 @@ int remove_path_from_gitmodules(const char *path)\n \n void stage_updated_gitmodules(struct index_state *istate)\n {\n+\tstruct cache_entry *ce;\n+\tint pos;\n+\n+\tpos = index_name_pos(istate, GITMODULES_FILE, strlen(GITMODULES_FILE));\n+\tce = (0 <= pos) ? istate->cache[pos] : NULL;\n+\n+\tif (ce)\n+\t\tmark_fsmonitor_invalid(istate, ce);\n+\n \tif (add_file_to_index(istate, GITMODULES_FILE, 0))\n \t\tdie(_(\"staging updated .gitmodules failed\"));\n }\n-- \n2.19.0.rc2.392.g5ba43deb5a-goog\n\n"},{"id":"357789","messageId":"85d96d65-2e74-7877-80ab-f74fdb81d500@gmail.com","threadId":"48510","inReplyTo":"20180906203444.162213-1-sbeller@google.com","subject":"Re: [PATCH] git-mv: allow submodules and fsmonitor to work together","fromName":"Ben Peart","fromEmail":"peartben@gmail.com","sentAt":"2018-09-10T15:58:41Z","receivedAt":"2018-09-10T15:58:46Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"\n\nOn 9/6/2018 4:34 PM, Stefan Beller wrote:\n> It was reported that\n> \n>    GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n> \n> breaks as the .gitmodules file is modified and staged after the fsmonitor\n> considers it clean. Mark the .gitmodules file to be not clean before\n> staging.\n> \n> Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Inspired-by: Ben Peart <benpeart@microsoft.com>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n> \n> I am not quite sure if this is the correct approach and handling of the\n> fsmonitor API, but it unbreaks the test.\n> \n>> Just naively adding mark_fsmonitor_invalid doesn't work, as then ...\n> \n> Adding it before the staging, works.\n> \n> Please double check!\n\nI took a look at this bug/patch and wondered why add_file_to_index() \nwasn't properly handling the .gitmodules file.  On investigation, I \nchased it down to what looks like a faulty test in \nis_staging_gitmodules_ok().\n\nI believe the following is a better patch for this bug:\n\ndiff --git a/submodule.c b/submodule.c\nindex 50cbf5f13e..1e7194af28 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -65,8 +65,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)\n         if ((pos >= 0) && (pos < istate->cache_nr)) {\n                 struct stat st;\n                 if (lstat(GITMODULES_FILE, &st) == 0 &&\n-                   ie_match_stat(istate, istate->cache[pos], &st,\n-                                 CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED)\n+                   ie_match_stat(istate, istate->cache[pos], &st, 0) & \nDATA_CHANGED)\n                         return 0;\n         }\n\nPlease double check but I just don't understand why the .gitmodules file \nshould force the fsmonitor data to be ignored.  This flag was added to \nenable proper behavior in the preload_thread() logic and I don't believe \nit is appropriate here.\n\nBen\n\n> \n> Thanks,\n> Stefan\n> \n>   submodule.c | 10 ++++++++++\n>   1 file changed, 10 insertions(+)\n> \n> diff --git a/submodule.c b/submodule.c\n> index 50cbf5f13ed..56b0d5fe24e 100644\n> --- a/submodule.c\n> +++ b/submodule.c\n> @@ -22,6 +22,7 @@\n>   #include \"worktree.h\"\n>   #include \"parse-options.h\"\n>   #include \"object-store.h\"\n> +#include \"fsmonitor.h\"\n>   \n>   static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;\n>   static struct string_list changed_submodule_names = STRING_LIST_INIT_DUP;\n> @@ -149,6 +150,15 @@ int remove_path_from_gitmodules(const char *path)\n>   \n>   void stage_updated_gitmodules(struct index_state *istate)\n>   {\n> +\tstruct cache_entry *ce;\n> +\tint pos;\n> +\n> +\tpos = index_name_pos(istate, GITMODULES_FILE, strlen(GITMODULES_FILE));\n> +\tce = (0 <= pos) ? istate->cache[pos] : NULL;\n> +\n> +\tif (ce)\n> +\t\tmark_fsmonitor_invalid(istate, ce);\n> +\n>   \tif (add_file_to_index(istate, GITMODULES_FILE, 0))\n>   \t\tdie(_(\"staging updated .gitmodules failed\"));\n>   }\n> \n"},{"id":"357792","messageId":"20180910162911.31920-1-benpeart@microsoft.com","threadId":"48510","inReplyTo":"85d96d65-2e74-7877-80ab-f74fdb81d500@gmail.com","subject":"[PATCH v1] git-mv: allow submodules and fsmonitor to work together","fromName":"Ben Peart","fromEmail":"benpeart@microsoft.com","sentAt":"2018-09-10T16:29:29Z","receivedAt":"2018-09-10T16:29:34Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"It was reported that\n\n   GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n\nbreaks as the fsmonitor data is out of sync with the state of the .gitmodules\nfile. Update is_staging_gitmodules_ok() so that it no longer tells\nie_match_stat() to ignore refreshing the fsmonitor data.\n\nReported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nHelped-by: Stefan Beller <sbeller@google.com>\nSigned-off-by: Ben Peart <benpeart@microsoft.com>\n---\n\nNotes:\n    Base Ref: v2.19.0-rc2\n    Web-Diff: https://github.com/benpeart/git/commit/ed30e1a885\n    Checkout: git fetch https://github.com/benpeart/git fsmonitor-t7411-v1 && git checkout ed30e1a885\n\n submodule.c | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/submodule.c b/submodule.c\nindex 50cbf5f13e..1e7194af28 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -65,8 +65,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)\n \tif ((pos >= 0) && (pos < istate->cache_nr)) {\n \t\tstruct stat st;\n \t\tif (lstat(GITMODULES_FILE, &st) == 0 &&\n-\t\t    ie_match_stat(istate, istate->cache[pos], &st,\n-\t\t\t\t  CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED)\n+\t\t    ie_match_stat(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)\n \t\t\treturn 0;\n \t}\n \n\nbase-commit: c05048d43925ab8edcb36663752c2b4541911231\n-- \n2.18.0.windows.1\n\n"},{"id":"357802","messageId":"CAGZ79kZmmULJHrPJS1=areXAP-nSK0_9UOUOry2Hd6aHSBrAiQ@mail.gmail.com","threadId":"48510","inReplyTo":"20180910162911.31920-1-benpeart@microsoft.com","subject":"Re: [PATCH v1] git-mv: allow submodules and fsmonitor to work together","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-10T17:07:40Z","receivedAt":"2018-09-10T17:07:54Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, Sep 10, 2018 at 9:29 AM Ben Peart <benpeart@microsoft.com> wrote:\n>\n> It was reported that\n>\n>    GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n>\n> breaks as the fsmonitor data is out of sync with the state of the .gitmodules\n> file. Update is_staging_gitmodules_ok() so that it no longer tells\n> ie_match_stat() to ignore refreshing the fsmonitor data.\n\nWondering how this came to be,\n7da9aba4178 (submodule: used correct index in is_staging_gitmodules_ok,\n2017-12-12) last touched this line, but is unrelated as the fsmonitor\nbehavior was\nthere before.\n\nBefore that, we have 883e248b8a0 (fsmonitor: teach git to optionally utilize a\nfile system monitor to speed up detecting new or changed files., 2017-09-22)\nthat was written by you, who knows the fsmonitor better than I do (or Brandon\nwho wrote the commit referenced above).\n\nLooking through the archive, it seems that we might have more such hidden\ngems?\n\nhttps://public-inbox.org/git/f50825a4-fa15-9f28-a079-853e78ee8e2e@gmail.com/\n\nAnyway, I think this is a better fix than what I proposed for sure.\n\nThanks for looking into this!\n\nStefan\n\n>\n> Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> Helped-by: Stefan Beller <sbeller@google.com>\n> Signed-off-by: Ben Peart <benpeart@microsoft.com>\n> ---\n>\n> Notes:\n>     Base Ref: v2.19.0-rc2\n>     Web-Diff: https://github.com/benpeart/git/commit/ed30e1a885\n>     Checkout: git fetch https://github.com/benpeart/git fsmonitor-t7411-v1 && git checkout ed30e1a885\n>\n>  submodule.c | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n>\n> diff --git a/submodule.c b/submodule.c\n> index 50cbf5f13e..1e7194af28 100644\n> --- a/submodule.c\n> +++ b/submodule.c\n> @@ -65,8 +65,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)\n>         if ((pos >= 0) && (pos < istate->cache_nr)) {\n>                 struct stat st;\n>                 if (lstat(GITMODULES_FILE, &st) == 0 &&\n> -                   ie_match_stat(istate, istate->cache[pos], &st,\n> -                                 CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED)\n> +                   ie_match_stat(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)\n>                         return 0;\n>         }\n>\n>\n> base-commit: c05048d43925ab8edcb36663752c2b4541911231\n> --\n> 2.18.0.windows.1\n>\n"},{"id":"357822","messageId":"6f8a4921-3b4e-e381-14da-60f0695446cd@gmail.com","threadId":"48510","inReplyTo":"CAGZ79kZmmULJHrPJS1=areXAP-nSK0_9UOUOry2Hd6aHSBrAiQ@mail.gmail.com","subject":"Re: [PATCH v1] git-mv: allow submodules and fsmonitor to work together","fromName":"Ben Peart","fromEmail":"peartben@gmail.com","sentAt":"2018-09-10T19:38:48Z","receivedAt":"2018-09-10T19:38:53Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"\n\nOn 9/10/2018 1:07 PM, Stefan Beller wrote:\n> On Mon, Sep 10, 2018 at 9:29 AM Ben Peart <benpeart@microsoft.com> wrote:\n>>\n>> It was reported that\n>>\n>>     GIT_FSMONITOR_TEST=$PWD/t7519/fsmonitor-all ./t7411-submodule-config.sh\n>>\n>> breaks as the fsmonitor data is out of sync with the state of the .gitmodules\n>> file. Update is_staging_gitmodules_ok() so that it no longer tells\n>> ie_match_stat() to ignore refreshing the fsmonitor data.\n> \n> Wondering how this came to be,\n> 7da9aba4178 (submodule: used correct index in is_staging_gitmodules_ok,\n> 2017-12-12) last touched this line, but is unrelated as the fsmonitor\n> behavior was\n> there before.\n> \n> Before that, we have 883e248b8a0 (fsmonitor: teach git to optionally utilize a\n> file system monitor to speed up detecting new or changed files., 2017-09-22)\n> that was written by you, who knows the fsmonitor better than I do (or Brandon\n> who wrote the commit referenced above).\n> \n> Looking through the archive, it seems that we might have more such hidden\n> gems?\n\nFortunately, the only one left is the one in preload_index() which is \nwhat the flag was created to handle so I think we're ok.\n\n> \n> https://public-inbox.org/git/f50825a4-fa15-9f28-a079-853e78ee8e2e@gmail.com/\n> \n> Anyway, I think this is a better fix than what I proposed for sure.\n> \n> Thanks for looking into this!\n> \n> Stefan\n> \n>>\n>> Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n>> Helped-by: Stefan Beller <sbeller@google.com>\n>> Signed-off-by: Ben Peart <benpeart@microsoft.com>\n>> ---\n>>\n>> Notes:\n>>      Base Ref: v2.19.0-rc2\n>>      Web-Diff: https://github.com/benpeart/git/commit/ed30e1a885\n>>      Checkout: git fetch https://github.com/benpeart/git fsmonitor-t7411-v1 && git checkout ed30e1a885\n>>\n>>   submodule.c | 3 +--\n>>   1 file changed, 1 insertion(+), 2 deletions(-)\n>>\n>> diff --git a/submodule.c b/submodule.c\n>> index 50cbf5f13e..1e7194af28 100644\n>> --- a/submodule.c\n>> +++ b/submodule.c\n>> @@ -65,8 +65,7 @@ int is_staging_gitmodules_ok(struct index_state *istate)\n>>          if ((pos >= 0) && (pos < istate->cache_nr)) {\n>>                  struct stat st;\n>>                  if (lstat(GITMODULES_FILE, &st) == 0 &&\n>> -                   ie_match_stat(istate, istate->cache[pos], &st,\n>> -                                 CE_MATCH_IGNORE_FSMONITOR) & DATA_CHANGED)\n>> +                   ie_match_stat(istate, istate->cache[pos], &st, 0) & DATA_CHANGED)\n>>                          return 0;\n>>          }\n>>\n>>\n>> base-commit: c05048d43925ab8edcb36663752c2b4541911231\n>> --\n>> 2.18.0.windows.1\n>>\n"}]}