{"thread":{"id":"29617","subject":"What's cooking in git.git (Feb 2012, #05; Mon, 13)","startedAt":"2012-02-13T20:42:48Z","lastAt":"2012-02-17T17:04:25Z","messageCount":23,"participants":["Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"184601","messageId":"7v4nuuea7r.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":null,"subject":"What's cooking in git.git (Feb 2012, #05; Mon, 13)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-13T20:42:48Z","receivedAt":"2012-02-13T20:42:48Z","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 '-' are\nonly in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'.\n\nThis round mosty consists of topics to fix new features introduced in\n1.7.9, in preparation for 1.7.9.1 maintenance release.  There are still a\nfew more to come.\n\nYou can find the changes described here in the integration branches of the\nrepositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[New Topics]\n\n* bl/gitweb-project-filter (2012-02-12) 1 commit\n  (merged to 'next' on 2012-02-13 at 35366b8)\n + gitweb: Harden and improve $project_filter page title\n\nAn update to the new feature to \"gitweb\" to show list of projects for\nintermediate levels in directory hierarchies, already slated for 1.7.10.\n\n* dp/i18n-libcharset (2012-02-13) 1 commit\n  (merged to 'next' on 2012-02-13 at 528de77)\n + Makefile: introduce CHARSET_LIB to link with -lcharset\n\nSome systems need to explicitly link -lcharset to get locale_charset().\n\n* lt/pull-no-edit (2012-02-12) 1 commit\n  (merged to 'next' on 2012-02-13 at 352f0cb)\n + \"git pull\" doesn't know \"--edit\"\n\nFor 1.7.10 where \"git merge\" by default spawns the editor when it can\nautomatically commit to record the resulting merge.\n\n* mh/war-on-extra-refs (2012-02-12) 7 commits\n  (merged to 'next' on 2012-02-13 at adb7353)\n + refs: remove the extra_refs API\n + clone: do not add alternate references to extra_refs\n + everything_local(): mark alternate refs as complete\n + fetch-pack.c: inline insert_alternate_refs()\n + fetch-pack.c: rename some parameters from \"path\" to \"refname\"\n + clone.c: move more code into the \"if (refs)\" conditional\n + t5700: document a failure of alternates to affect fetch\n\nInternal API clean-up that is very cleanly done.\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* bw/inet-pton-ntop-compat (2012-02-05) 1 commit\n  (merged to 'next' on 2012-02-06 at 61303e6)\n + Drop system includes from inet_pton/inet_ntop compatibility wrappers\n\nThe inclusion order of header files bites Solaris again and this fixes it.\n\n* fc/zsh-completion (2012-02-06) 3 commits\n  (merged to 'next' on 2012-02-06 at c94dd12)\n + completion: simplify __gitcomp and __gitcomp_nl implementations\n + completion: use ls -1 instead of rolling a loop to do that ourselves\n + completion: work around zsh option propagation bug\n\nFix git subcommand completion for zsh (in contrib/completion).\n\n* jc/checkout-out-of-unborn (2012-02-06) 1 commit\n  (merged to 'next' on 2012-02-07 at 60eb328)\n + git checkout -b: allow switching out of an unborn branch\n\n\"checkout -b\" did not allow switching out of an unborn branch.\n\n* jc/maint-commit-ignore-i-t-a (2012-02-07) 1 commit\n  (merged to 'next' on 2012-02-10 at e0040cf)\n + commit: ignore intent-to-add entries instead of refusing\n\nReplaces the nd/commit-ignore-i-t-a series that was made unnecessary\ncomplicated by bad suggestions I made earlier.\n\n* jc/maint-mailmap-output (2012-02-06) 1 commit\n  (merged to 'next' on 2012-02-06 at 0a21425)\n + mailmap: always return a plain mail address from map_user()\n\nmap_user() was not rewriting its output correctly, which resulted in the\nuser visible symptom that \"git blame -e\" sometimes showed excess '>' at\nthe end of email addresses.\n\n* jk/maint-tag-show-fixes (2012-02-08) 3 commits\n  (merged to 'next' on 2012-02-08 at 18459c4)\n + tag: do not show non-tag contents with \"-n\"\n + tag: die when listing missing or corrupt objects\n + tag: fix output of \"tag -n\" when errors occur\n\nBugfixes to \"git tag -n\" that lacked much error checking.\n\n* jk/prompt-fallback-to-tty (2012-02-03) 2 commits\n  (merged to 'next' on 2012-02-06 at c0c995a)\n + prompt: fall back to terminal if askpass fails\n + prompt: clean up strbuf usage\n\nThe code to ask for password did not fall back to the terminal input when\nGIT_ASKPASS is set but does not work (e.g. lack of X with GUI askpass\nhelper).\n\n* jn/gitweb-search-utf-8 (2012-02-03) 1 commit\n  (merged to 'next' on 2012-02-05 at 055e446)\n + gitweb: Allow UTF-8 encoded CGI query parameters and path_info\n\nSearch box in \"gitweb\" did not accept non-ASCII characters correctly.\n\n* jn/merge-no-edit-fix (2012-02-09) 1 commit\n  (merged to 'next' on 2012-02-10 at 014eec9)\n + merge: do not launch an editor on \"--no-edit $tag\"\n\nIn 1.7.9, \"merge --no-edit $tag\" incorrectly ignored --no-edit.\n\n* mm/empty-loose-error-message (2012-02-06) 1 commit\n  (merged to 'next' on 2012-02-07 at f119cac)\n + fsck: give accurate error message on empty loose object files\n\nUpdates the error message emitted when we see an empty loose object.\n\n* mp/make-cleanse-x-for-exe (2012-02-09) 1 commit\n  (merged to 'next' on 2012-02-09 at 35cc89d)\n + Explicitly set X to avoid potential build breakage\n\nThe makefile allowed environment variable X seep into it result in\ncommand names suffixed with unnecessary strings.\n\n* nd/cache-tree-api-refactor (2012-02-07) 1 commit\n  (merged to 'next' on 2012-02-08 at a9abbca)\n + cache-tree: update API to take abitrary flags\n\nCode cleanup.\n\n* nd/diffstat-gramnum (2012-02-03) 1 commit\n  (merged to 'next' on 2012-02-05 at 7335ecc)\n + Use correct grammar in diffstat summary line\n\nThe commands in the \"git diff\" family and \"git apply --stat\" that count\nthe number of files changed and the number of lines inserted/deleted have\nbeen updated to match the output from \"diffstat\".  This also opens the\ndoor to i18n this line.\n\n* nd/find-pack-entry-recent-cache-invalidation (2012-02-01) 2 commits\n  (merged to 'next' on 2012-02-01 at e26aed0)\n + find_pack_entry(): do not keep packed_git pointer locally\n + sha1_file.c: move the core logic of find_pack_entry() into fill_pack_entry()\n\n* nk/ctype-for-perf (2012-02-10) 2 commits\n  (merged to 'next' on 2012-02-10 at b41c6bb)\n + ctype: implement islower/isupper macro\n + ctype.c only wants git-compat-util.h\n\n* tt/profile-build-fix (2012-02-09) 2 commits\n  (merged to 'next' on 2012-02-09 at 1c183af)\n + Makefile: fix syntax for older make\n  (merged to 'next' on 2012-02-07 at c8c5f3f)\n + Fix build problems related to profile-directed optimization\n\n--------------------------------------------------\n[Stalled]\n\n* jc/advise-push-default (2011-12-18) 1 commit\n - push: hint to use push.default=upstream when appropriate\n\nPeff had a good suggestion outlining an updated code structure so that\nsomebody new can try to dip his or her toes in the development. Any\ntakers?\n\n* ss/git-svn-prompt-sans-terminal (2012-01-04) 3 commits\n - fixup! 15eaaf4\n - git-svn, perl/Git.pm: extend Git::prompt helper for querying users\n - perl/Git.pm: \"prompt\" helper to honor GIT_ASKPASS and SSH_ASKPASS\n\nThe bottom one has been replaced with a rewrite based on comments from\nÆvar. The second one needs more work, both in perl/Git.pm and prompt.c, to\ngive precedence to tty over SSH_ASKPASS when terminal is available.\n\n* jc/split-blob (2012-01-24) 6 commits\n - chunked-object: streaming checkout\n - chunked-object: fallback checkout codepaths\n - bulk-checkin: support chunked-object encoding\n - bulk-checkin: allow the same data to be multiply hashed\n - new representation types in the packstream\n - varint-in-pack: refactor varint encoding/decoding\n\nNot ready.\n\nI finished the streaming checkout codepath, but as explained in 127b177\n(bulk-checkin: support chunked-object encoding, 2011-11-30), these are\nstill early steps of a long and painful journey. At least pack-objects and\nfsck need to learn the new encoding for the series to be usable locally,\nand then index-pack/unpack-objects needs to learn it to be used remotely.\n\nGiven that I heard a lot of noise that people want large files, and that I\nwas asked by somebody at GitTogether'11 privately for an advice on how to\npay developers (not me) to help adding necessary support, I am somewhat\ndissapointed that the original patch series that was sent almost two\nmonths ago still remains here without much comments and updates from the\ndeveloper community. I even made the interface to the logic that decides\nwhere to split chunks easily replaceable, and I deliberately made the\nlogic in the original patch extremely stupid to entice others, especially\nthe \"bup\" fanboys, to come up with a better logic, thinking that giving\npeople an easy target to shoot for, they may be encouraged to help\nout. The plan is not working :-(.\n\n* nd/columns (2012-02-08) 15 commits\n - column: Fix some compiler and sparse warnings\n - column: add a corner-case test to t3200\n - columns: minimum coding style fixes\n - tag: add --column\n - column: support piping stdout to external git-column process\n - status: add --column\n - branch: add --column\n - help: reuse print_columns() for help -a\n - column: add column.ui for default column output settings\n - column: support columns with different widths\n - column: add columnar layout\n - Stop starting pager recursively\n - Add git-column and column mode parsing\n - column: add API to print items in columns\n - Save terminal width before setting up pager\n\nThe \"show list of ...\" mode of a handful of commands learn to produce\ncolumn-oriented output.\n\nExpecting a reroll.\n\n--------------------------------------------------\n[Cooking]\n\n* jn/ancient-meld-support (2012-02-10) 1 commit\n  (merged to 'next' on 2012-02-13 at 28aca31)\n + mergetools/meld: Use --help output to detect --output support\n\nMore reliably tell if the given version of \"meld\" supports --output\noption.\n\n* jk/config-include (2012-02-06) 2 commits\n  (merged to 'next' on 2012-02-13 at 307ddf6)\n + config: add include directive\n + docs: add a basic description of the config API\n\nAn assignment to the include.path pseudo-variable causes the named file\nto be included in-place when Git looks up configuration variables.\n\n* jk/userdiff-config-simplify (2012-02-07) 1 commit\n  (merged to 'next' on 2012-02-10 at e9854c1)\n + drop odd return value semantics from userdiff_config\n\nCode cleanup.\n\n* tg/tag-points-at (2012-02-13) 2 commits\n  (merged to 'next' on 2012-02-13 at a8f4046)\n + builtin/tag.c: Fix a sparse warning\n  (merged to 'next' on 2012-02-10 at 4bff88f)\n + tag: add --points-at list option\n\n* jl/maint-submodule-relative (2012-02-09) 2 commits\n - submodules: always use a relative path from gitdir to work tree\n - submodules: always use a relative path to gitdir\n\nThe second one looked iffy.\n\n* ld/git-p4-expanded-keywords (2012-02-09) 2 commits\n - git-p4: initial demonstration of possible RCS keyword fixup\n - git-p4: add test case for RCS keywords\n\nWaiting for reviews and user reports.\n\n* jk/grep-binary-attribute (2012-02-02) 9 commits\n  (merged to 'next' on 2012-02-05 at 9dffa7e)\n + grep: pre-load userdiff drivers when threaded\n + grep: load file data after checking binary-ness\n + grep: respect diff attributes for binary-ness\n + grep: cache userdiff_driver in grep_source\n + grep: drop grep_buffer's \"name\" parameter\n + convert git-grep to use grep_source interface\n + grep: refactor the concept of \"grep source\" into an object\n + grep: move sha1-reading mutex into low-level code\n + grep: make locking flag global\n\nFixes a longstanding bug that there was no way to tell \"git grep\" that a\npath may look like text but it is not, which \"git diff\" can do using the\nattributes system. Now \"git grep\" honors the same \"binary\" (or \"-diff\")\nattribute.\n\nWill merge to 'master' after 1.7.9.1 settles.\n\n* jk/git-dir-lookup (2012-02-02) 1 commit\n  (merged to 'next' on 2012-02-05 at 1856d74)\n + standardize and improve lookup rules for external local repos\n\nWhen you have both .../foo and .../foo.git, \"git clone .../foo\" did not\nfavor the former but the latter.\n\nWill merge to 'master' after 1.7.9.1 settles.\n\n* nd/pack-objects-parseopt (2012-02-01) 3 commits\n  (merged to 'next' on 2012-02-05 at d0dc25d)\n + pack-objects: convert to use parse_options()\n + pack-objects: remove bogus comment\n + pack-objects: do not accept \"--index-version=version,\"\n\n\"pack-objects\" learned use parse-options, losing custom command line\nparsing code.\n\nWill merge to 'master' after 1.7.9.1 settles.\n"},{"id":"184642","messageId":"7vk43p98wg.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":"7v4nuuea7r.fsf@alter.siamese.dyndns.org","subject":"An incremental update to \"What's cooking\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-14T07:22:23Z","receivedAt":"2012-02-14T07:22:23Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here is the tonight's snapshot as an incremental update to the issue #5\nof \"What's cooking\" for this month.\n\nI'd like to merge jn/merge-no-edit-fix topic to 'maint' and release the\nfirst maintenance release 1.7.9.1 soonish. The topic is merged to 'master'\nalready, and it is very much appreciated if people can test and eyeball it\nto make sure we fixed what is broken in the vanilla 1.7.9 release without\ncausing regression in unexpected places.\n\nThanks, and goodnight.\n\n----------------------------------------------------------------\n\nBorn topics\n\n[New Topics]\n\n * cb/maint-rev-list-verify-object (2012-02-13) 1 commit\n  - git rev-list: fix invalid typecast\n \n Fixes an obscure bug in \"rev-list --verify\" that skipped verification\n depending on the phase of the moon, which dates back to 1.7.8.x series.\n\n * cb/maint-t5541-make-server-port-portable (2012-02-13) 1 commit\n  - t5541: check error message against the real port number used\n \n Test fix.\n\n * cb/receive-pack-keep-errors (2012-02-13) 1 commit\n  - do not override receive-pack errors\n \n One hunk and the word \"override\" in the description were a bit iffy.\n\n * cb/transfer-no-progress (2012-02-13) 1 commit\n  - push/fetch/clone --no-progress suppresses progress output\n \n The transport programs semi-ignored --no-progress and showed progress when\n sending their output to a terminal.\n\n * jk/diff-highlight (2012-02-13) 5 commits\n  - diff-highlight: document some non-optimal cases\n  - diff-highlight: match multi-line hunks\n  - diff-highlight: refactor to prepare for multi-line hunks\n  - diff-highlight: don't highlight whole lines\n  - diff-highlight: make perl strict and warnings fatal\n \n Updates diff-highlight (in contrib/).\n\n * zj/decimal-width (2012-02-13) 1 commit\n  - (sign-off???) make lineno_width() from blame reusable for others\n  (this branch is used by zj/diff-stat-dyncol.)\n \n Refactoring.\n\n * zj/term-columns (2012-02-13) 1 commit\n  - pager: find out the terminal width before spawning the pager\n  (this branch is used by zj/diff-stat-dyncol.)\n \n Fixes \"git -p cmd\" for any subcommand that cares about the true terminal\n width.\n\n * hv/submodule-recurse-push (2012-02-13) 3 commits\n  - push: teach --recurse-submodules the on-demand option\n  - Refactor submodule push check to use string list instead of integer\n  - Teach revision walking machinery to walk multiple times sequencially\n \n The bottom one was not clearly explained.\n\n * zj/diff-stat-dyncol (2012-02-13) 2 commits\n  - diff --stat: use the full terminal width\n  - Merge branch 'zj/term-columns' into zj/diff-stat-dyncol\n  (this branch uses zj/decimal-width and zj/term-columns.)\n \n This breaks tests. Perhaps it is not worth using the decimal-width stuff\n for this series, at least initially.\n\n--------------------------------------------------\n[Cooking]\n\n-* ld/git-p4-expanded-keywords (2012-02-09) 2 commits\n+* ld/git-p4-expanded-keywords (2012-02-13) 3 commits\n+ - git-p4: more RCS tests\n  - git-p4: initial demonstration of possible RCS keyword fixup\n  - git-p4: add test case for RCS keywords\n \n-Waiting for reviews and user reports.\n+Waiting for the dust to settle.\n"},{"id":"184700","messageId":"20120214214729.GA24711@sigill.intra.peff.net","threadId":"29617","inReplyTo":"7v4nuuea7r.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Feb 2012, #05; Mon, 13)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-14T21:47:29Z","receivedAt":"2012-02-14T21:47:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 13, 2012 at 12:42:48PM -0800, Junio C Hamano wrote:\n\n> * jk/config-include (2012-02-06) 2 commits\n>   (merged to 'next' on 2012-02-13 at 307ddf6)\n>  + config: add include directive\n>  + docs: add a basic description of the config API\n> \n> An assignment to the include.path pseudo-variable causes the named file\n> to be included in-place when Git looks up configuration variables.\n\nYikes. I was planning to re-roll this, but got sidetracked discussing\nDavid's git-cola case. Besides a few minor tweaks in the documentation\npatch, the actual include patch is buggy, and accidentally turns on\nincludes for \"git config --list\".\n\nDo you want to revert and re-do to make master pretty, or should I just\nbuild on top?\n\n-Peff\n"},{"id":"184706","messageId":"7vmx8l5aw3.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":"20120214214729.GA24711@sigill.intra.peff.net","subject":"Re: What's cooking in git.git (Feb 2012, #05; Mon, 13)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-14T22:05:16Z","receivedAt":"2012-02-14T22:05:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Feb 13, 2012 at 12:42:48PM -0800, Junio C Hamano wrote:\n>\n>> * jk/config-include (2012-02-06) 2 commits\n>>   (merged to 'next' on 2012-02-13 at 307ddf6)\n>>  + config: add include directive\n>>  + docs: add a basic description of the config API\n>> \n>> An assignment to the include.path pseudo-variable causes the named file\n>> to be included in-place when Git looks up configuration variables.\n>\n> Yikes. I was planning to re-roll this, but got sidetracked discussing\n> David's git-cola case. Besides a few minor tweaks in the documentation\n> patch, the actual include patch is buggy, and accidentally turns on\n> includes for \"git config --list\".\n\nHmm, I thought t1305 covered \"config --list\", and ... oops, it makes sure\nthe output contains the inclusion.\n\n> Do you want to revert and re-do to make master pretty, or should I just\n> build on top?\n\nDo you mean 'next'?\n"},{"id":"184710","messageId":"20120214220953.GC24802@sigill.intra.peff.net","threadId":"29617","inReplyTo":"7vmx8l5aw3.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Feb 2012, #05; Mon, 13)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-14T22:09:53Z","receivedAt":"2012-02-14T22:09:53Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 14, 2012 at 02:05:16PM -0800, Junio C Hamano wrote:\n\n> > Yikes. I was planning to re-roll this, but got sidetracked discussing\n> > David's git-cola case. Besides a few minor tweaks in the documentation\n> > patch, the actual include patch is buggy, and accidentally turns on\n> > includes for \"git config --list\".\n> \n> Hmm, I thought t1305 covered \"config --list\", and ... oops, it makes sure\n> the output contains the inclusion.\n\nYes. It should include it (and does correctly) when not using any\nper-file options, but does not correctly turn it off for the per-file\ncase (because we bail to regular git_config instead of custom lookup\ncode).\n\n> > Do you want to revert and re-do to make master pretty, or should I just\n> > build on top?\n> \n> Do you mean 'next'?\n\nI meant \"revert from next and re-reroll, so that when the re-roll gets\nmerged to master, the result there will look pretty\".\n\n-Peff\n"},{"id":"184806","messageId":"20120216080102.GA11793@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120214220953.GC24802@sigill.intra.peff.net","subject":"[PATCH 0/8] config-include fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:01:02Z","receivedAt":"2012-02-16T08:01:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 14, 2012 at 05:09:53PM -0500, Jeff King wrote:\n\n> > Hmm, I thought t1305 covered \"config --list\", and ... oops, it makes sure\n> > the output contains the inclusion.\n> \n> Yes. It should include it (and does correctly) when not using any\n> per-file options, but does not correctly turn it off for the per-file\n> case (because we bail to regular git_config instead of custom lookup\n> code).\n> \n> > > Do you want to revert and re-do to make master pretty, or should I just\n> > > build on top?\n> > \n> > Do you mean 'next'?\n> \n> I meant \"revert from next and re-reroll, so that when the re-roll gets\n> merged to master, the result there will look pretty\".\n\nThe fix for this is pretty straightforward. However, I took the\nopportunity to do some cleanup and fix some minor bugs while I was in\nthe area, and ended up with quite a big series.\n\nI prepared this on top of what you have queued in jk/config-include.\nHowever, all of the cleanup is semantically independent of the topic\n(though there are a few minor textual conflicts). If I were re-rolling,\nI would put it all at the front, then squash patch 8 into my prior\n\"implement config includes\" patch.\n\nThe patches are:\n\n  [1/8]: t1300: add missing &&-chaining\n\nObvious cleanup.\n\n  [2/8]: config: copy the return value of prefix_filename\n\nVery minor bug.\n\n  [3/8]: config: teach git_config_set_multivar_in_file a default path\n  [4/8]: config: teach git_config_rename_section a file argument\n  [5/8]: config: provide a version of git_config with more options\n  [6/8]: config: stop using config_exclusive_filename\n  [7/8]: config: eliminate config_exclusive_filename\n\nThis is all cleanup which makes config_exclusive_filename go away. It's\nnot strictly necessary for this series, but it's something I've been\nwanting to clean up for a while. And it does fix a few minor bugs (see\npatch 6/8). And the refactoring in 5/8 lays the groundwork for 8/8.\n\n  [8/8]: config: do not respect includes for single-file --list\n\nThe actual fix for the regression in my config-include patch.\n\n-Peff\n"},{"id":"184807","messageId":"20120216080218.GA11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 1/8] t1300: add missing &&-chaining","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:02:18Z","receivedAt":"2012-02-16T08:02:18Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Signed-off-by: Jeff King <peff@peff.net>\n---\n t/t1300-repo-config.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 0690e0e..6de46bb 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -451,7 +451,7 @@ test_expect_success 'refer config from subdirectory' '\n \tmkdir x &&\n \t(\n \t\tcd x &&\n-\t\techo strasse >expect\n+\t\techo strasse >expect &&\n \t\tgit config --get --file ../other-config ein.bahn >actual &&\n \t\ttest_cmp expect actual\n \t)\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184808","messageId":"20120216080352.GB11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 2/8] config: copy the return value of prefix_filename","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:03:52Z","receivedAt":"2012-02-16T08:03:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The prefix_filename function returns a pointer to a static\nbuffer which may be overwritten by subsequent calls. Since\nwe are going to keep the result around for a while, let's be\nsure to duplicate it for safety.\n\nI don't think this can be triggered as a bug in the current\ncode, but it's a good idea to be defensive, as any resulting\nbug would be quite subtle.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI was tempted to simply use OPT_FILENAME to get the argument to \"-f\",\nwhich would handle the prefixing for us. However, we can also get the\nvalue from $GIT_CONFIG. That value doesn't actually run through this\ncode currently, but I think it should (and I fix this in patch 6).\n\n builtin/config.c |    7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 09bf778..5a43a3c 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -391,9 +391,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tconfig_exclusive_filename = git_pathdup(\"config\");\n \telse if (given_config_file) {\n \t\tif (!is_absolute_path(given_config_file) && prefix)\n-\t\t\tconfig_exclusive_filename = prefix_filename(prefix,\n-\t\t\t\t\t\t\t\t    strlen(prefix),\n-\t\t\t\t\t\t\t\t    given_config_file);\n+\t\t\tconfig_exclusive_filename =\n+\t\t\t\txstrdup(prefix_filename(prefix,\n+\t\t\t\t\t\t\tstrlen(prefix),\n+\t\t\t\t\t\t\tgiven_config_file));\n \t\telse\n \t\t\tconfig_exclusive_filename = given_config_file;\n \t}\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184809","messageId":"20120216080405.GC11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 3/8] config: teach git_config_set_multivar_in_file a default path","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:04:05Z","receivedAt":"2012-02-16T08:04:05Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The git_config_set_multivar_in_file function takes a\nfilename argument to specify the file into which the values\nshould be written. Currently, this value must be non-NULL.\nCallers which want to write to the default location must use\nthe regular, non-\"in_file\" version, which will either write\nto config_exclusive_filename, or to the repo config if the\nexclusive filename is NULL.\n\nLet's migrate the \"default to using repo config\" logic into\nthe \"in_file\" form. That will let callers get the same\ndefault-if-NULL behavior as one gets with\nconfig_exclusive_filename, but without having to use the\nglobal variable.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n config.c |   20 +++++++-------------\n 1 file changed, 7 insertions(+), 13 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex e3fcf75..a9eec58 100644\n--- a/config.c\n+++ b/config.c\n@@ -1300,6 +1300,7 @@ int git_config_set_multivar_in_file(const char *config_filename,\n \tint fd = -1, in_fd;\n \tint ret;\n \tstruct lock_file *lock = NULL;\n+\tchar *filename_buf = NULL;\n \n \t/* parse-key returns negative; flip the sign to feed exit(3) */\n \tret = 0 - git_config_parse_key(key, &store.key, &store.baselen);\n@@ -1308,6 +1309,8 @@ int git_config_set_multivar_in_file(const char *config_filename,\n \n \tstore.multi_replace = multi_replace;\n \n+\tif (!config_filename)\n+\t\tconfig_filename = filename_buf = git_pathdup(\"config\");\n \n \t/*\n \t * The lock serves a purpose in addition to locking: the new\n@@ -1477,6 +1480,7 @@ int git_config_set_multivar_in_file(const char *config_filename,\n out_free:\n \tif (lock)\n \t\trollback_lock_file(lock);\n+\tfree(filename_buf);\n \treturn ret;\n \n write_err_out:\n@@ -1488,19 +1492,9 @@ write_err_out:\n int git_config_set_multivar(const char *key, const char *value,\n \t\t\tconst char *value_regex, int multi_replace)\n {\n-\tconst char *config_filename;\n-\tchar *buf = NULL;\n-\tint ret;\n-\n-\tif (config_exclusive_filename)\n-\t\tconfig_filename = config_exclusive_filename;\n-\telse\n-\t\tconfig_filename = buf = git_pathdup(\"config\");\n-\n-\tret = git_config_set_multivar_in_file(config_filename, key, value,\n-\t\t\t\t\tvalue_regex, multi_replace);\n-\tfree(buf);\n-\treturn ret;\n+\treturn git_config_set_multivar_in_file(config_exclusive_filename,\n+\t\t\t\t\t       key, value, value_regex,\n+\t\t\t\t\t       multi_replace);\n }\n \n static int section_name_match (const char *buf, const char *name)\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184810","messageId":"20120216080425.GD11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 4/8] config: teach git_config_rename_section a file argument","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:04:25Z","receivedAt":"2012-02-16T08:04:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The other config-writing functions (git_config_set and\ngit_config_set_multivar) each have an -\"in_file\" version to\nwrite a specific file. Let's add one for rename_section,\nwith the eventual goal of moving away from the magic\nconfig_exclusive_filename global.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n cache.h  |    1 +\n config.c |   20 +++++++++++++-------\n 2 files changed, 14 insertions(+), 7 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 94f3eaf..7e375ce 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1130,6 +1130,7 @@ extern int git_config_parse_key(const char *, char **, int *);\n extern int git_config_set_multivar(const char *, const char *, const char *, int);\n extern int git_config_set_multivar_in_file(const char *, const char *, const char *, const char *, int);\n extern int git_config_rename_section(const char *, const char *);\n+extern int git_config_rename_section_in_file(const char *, const char *, const char *);\n extern const char *git_etc_gitconfig(void);\n extern int check_repository_format_version(const char *var, const char *value, void *cb);\n extern int git_env_bool(const char *, int);\ndiff --git a/config.c b/config.c\nindex a9eec58..c456600 100644\n--- a/config.c\n+++ b/config.c\n@@ -1537,19 +1537,19 @@ static int section_name_match (const char *buf, const char *name)\n }\n \n /* if new_name == NULL, the section is removed instead */\n-int git_config_rename_section(const char *old_name, const char *new_name)\n+int git_config_rename_section_in_file(const char *config_filename,\n+\t\t\t\t      const char *old_name, const char *new_name)\n {\n \tint ret = 0, remove = 0;\n-\tchar *config_filename;\n+\tchar *filename_buf = NULL;\n \tstruct lock_file *lock = xcalloc(sizeof(struct lock_file), 1);\n \tint out_fd;\n \tchar buf[1024];\n \tFILE *config_file;\n \n-\tif (config_exclusive_filename)\n-\t\tconfig_filename = xstrdup(config_exclusive_filename);\n-\telse\n-\t\tconfig_filename = git_pathdup(\"config\");\n+\tif (!config_filename)\n+\t\tconfig_filename = filename_buf = git_pathdup(\"config\");\n+\n \tout_fd = hold_lock_file_for_update(lock, config_filename, 0);\n \tif (out_fd < 0) {\n \t\tret = error(\"could not lock config file %s\", config_filename);\n@@ -1613,10 +1613,16 @@ unlock_and_out:\n \tif (commit_lock_file(lock) < 0)\n \t\tret = error(\"could not commit config file %s\", config_filename);\n out:\n-\tfree(config_filename);\n+\tfree(filename_buf);\n \treturn ret;\n }\n \n+int git_config_rename_section(const char *old_name, const char *new_name)\n+{\n+\treturn git_config_rename_section_in_file(config_exclusive_filename,\n+\t\t\t\t\t\t old_name, new_name);\n+}\n+\n /*\n  * Call this to report error for your variable that should not\n  * get a boolean value (i.e. \"[my] var\" means \"true\").\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184811","messageId":"20120216080555.GE11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 5/8] config: provide a version of git_config with more options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:05:56Z","receivedAt":"2012-02-16T08:05:56Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Callers may want to provide a specific version of a file in\nwhich to look for config. Right now this can be done by\nsetting the magic global config_exclusive_filename variable.\nBy providing a version of git_config that takes a filename,\nwe can take a step towards making this magic global go away.\n\nFurthermore, by providing a more \"advanced\" interface, we\nnow have a a natural place to add new options for callers\nlike git-config, which care about tweaking the specifics of\nconfig lookup, without disturbing the large number of\n\"simple\" users (i.e., every other part of git).\n\nThe astute reader of this patch may notice that the logic\nfor handling config_exclusive_filename was taken out of\ngit_config_early, but added into git_config. This means that\ngit_config_early will no longer respect config_exclusive_filename.\nThat's OK, because the only other caller of git_config_early\nis check_repository_format_gently, but the only function\nwhich sets config_exclusive_filename is cmd_config, which\ndoes not call check_repository_format_gently (and if it did,\nit would have been a bug, anyway, as we would be checking\nthe repository format in the wrong file).\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nObviously this could also learn about a respect_includes flag, and it in\nfact does in patch 8. I didn't include it in the initial version because\nthis part of the series is really about refactoring the\nconfig_exclusive_filename stuff (and is semantically independent of the\nnotion of included files).\n\n cache.h  |    1 +\n config.c |   22 +++++++++++++++++-----\n 2 files changed, 18 insertions(+), 5 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 7e375ce..7cb8874 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1115,6 +1115,7 @@ extern int git_config_from_file(config_fn_t fn, const char *, void *);\n extern void git_config_push_parameter(const char *text);\n extern int git_config_from_parameters(config_fn_t fn, void *data);\n extern int git_config(config_fn_t fn, void *);\n+extern int git_config_with_options(config_fn_t fn, void *, const char *filename);\n extern int git_config_early(config_fn_t fn, void *, const char *repo_config);\n extern int git_parse_ulong(const char *, unsigned long *);\n extern int git_config_int(const char *, const char *);\ndiff --git a/config.c b/config.c\nindex c456600..fbf883d 100644\n--- a/config.c\n+++ b/config.c\n@@ -942,9 +942,6 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)\n \tint ret = 0, found = 0;\n \tconst char *home = NULL;\n \n-\t/* Setting $GIT_CONFIG makes git read _only_ the given config file. */\n-\tif (config_exclusive_filename)\n-\t\treturn git_config_from_file(fn, config_exclusive_filename, data);\n \tif (git_config_system() && !access(git_etc_gitconfig(), R_OK)) {\n \t\tret += git_config_from_file(fn, git_etc_gitconfig(),\n \t\t\t\t\t    data);\n@@ -980,7 +977,8 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)\n \treturn ret == 0 ? found : ret;\n }\n \n-int git_config(config_fn_t fn, void *data)\n+int git_config_with_options(config_fn_t fn, void *data,\n+\t\t\t    const char *filename)\n {\n \tchar *repo_config = NULL;\n \tint ret;\n@@ -988,14 +986,28 @@ int git_config(config_fn_t fn, void *data)\n \n \tinc.fn = fn;\n \tinc.data = data;\n+\tfn = git_config_include;\n+\tdata = &inc;\n+\n+\t/*\n+\t * If we have a specific filename, use it. Otherwise, follow the\n+\t * regular lookup sequence.\n+\t */\n+\tif (filename)\n+\t\treturn git_config_from_file(fn, filename, data);\n \n \trepo_config = git_pathdup(\"config\");\n-\tret = git_config_early(git_config_include, &inc, repo_config);\n+\tret = git_config_early(fn, data, repo_config);\n \tif (repo_config)\n \t\tfree(repo_config);\n \treturn ret;\n }\n \n+int git_config(config_fn_t fn, void *data)\n+{\n+\treturn git_config_with_options(fn, data, config_exclusive_filename);\n+}\n+\n /*\n  * Find all the stuff for git_config_set() below.\n  */\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184812","messageId":"20120216080732.GF11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 6/8] config: stop using config_exclusive_filename","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:07:32Z","receivedAt":"2012-02-16T08:07:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The git-config command sometimes operates on the default set\nof config files (either reading from all, or writing to repo\nconfig), and sometimes operates on a specific file. In the\nlatter case, we set the magic global config_exclusive_filename,\nand the code in config.c does the right thing.\n\nInstead, let's have git-config use the \"advanced\" variants\nof config.c's functions which let it specify an individual\nfilename (or NULL for the default). This makes the code a\nlot more obvious, and fixes two small bugs:\n\n  1. A relative path specified by GIT_CONFIG=foo will look\n     in the wrong directory if we have to chdir as part of\n     repository setup. We already handle this properly for\n     \"git config -f foo\", but the GIT_CONFIG lookup used\n     config_exclusive_filename directly. By dropping to a\n     single magic variable, the GIT_CONFIG case now just\n     works.\n\n  2. Calling \"git config -f foo --edit\" would not respect\n     core.editor. This is because just before editing, we\n     called git_config, which would respect the\n     config_exclusive_filename setting, even though this\n     particular git_config call was not about looking in the\n     user's specified file, but rather about loading actual\n     git config, just as any other git program would.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThe diffstat is slightly disappointing. It really is a one-for-one\nconversion in almost every case, but the functions and variable names\nare so bloody long that I had to wrap the calls to stay under 80\ncharacters.\n\n builtin/config.c       |   61 ++++++++++++++++++++++++++++-------------------\n t/t1300-repo-config.sh |   25 +++++++++++++++++++\n 2 files changed, 61 insertions(+), 25 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 5a43a3c..8901dd9 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -167,7 +167,7 @@ static int get_value(const char *key_, const char *regex_)\n \tconfig_fn_t fn;\n \tvoid *data;\n \n-\tlocal = config_exclusive_filename;\n+\tlocal = given_config_file;\n \tif (!local) {\n \t\tconst char *home = getenv(\"HOME\");\n \t\tlocal = repo_config = git_pathdup(\"config\");\n@@ -315,7 +315,8 @@ static void get_color(const char *def_color)\n {\n \tget_color_found = 0;\n \tparsed_color[0] = '\\0';\n-\tgit_config(git_get_color_config, NULL);\n+\tgit_config_with_options(git_get_color_config, NULL,\n+\t\t\t\tgiven_config_file);\n \n \tif (!get_color_found && def_color)\n \t\tcolor_parse(def_color, \"command line\", parsed_color);\n@@ -342,7 +343,8 @@ static int get_colorbool(int print)\n {\n \tget_colorbool_found = -1;\n \tget_diff_color_found = -1;\n-\tgit_config(git_get_colorbool_config, NULL);\n+\tgit_config_with_options(git_get_colorbool_config, NULL,\n+\t\t\t\tgiven_config_file);\n \n \tif (get_colorbool_found < 0) {\n \t\tif (!strcmp(get_colorbool_slot, \"color.diff\"))\n@@ -365,7 +367,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \tint nongit = !startup_info->have_repository;\n \tchar *value;\n \n-\tconfig_exclusive_filename = getenv(CONFIG_ENVIRONMENT);\n+\tgiven_config_file = getenv(CONFIG_ENVIRONMENT);\n \n \targc = parse_options(argc, argv, prefix, builtin_config_options,\n \t\t\t     builtin_config_usage,\n@@ -380,27 +382,27 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \t\tchar *home = getenv(\"HOME\");\n \t\tif (home) {\n \t\t\tchar *user_config = xstrdup(mkpath(\"%s/.gitconfig\", home));\n-\t\t\tconfig_exclusive_filename = user_config;\n+\t\t\tgiven_config_file = user_config;\n \t\t} else {\n \t\t\tdie(\"$HOME not set\");\n \t\t}\n \t}\n \telse if (use_system_config)\n-\t\tconfig_exclusive_filename = git_etc_gitconfig();\n+\t\tgiven_config_file = git_etc_gitconfig();\n \telse if (use_local_config)\n-\t\tconfig_exclusive_filename = git_pathdup(\"config\");\n+\t\tgiven_config_file = git_pathdup(\"config\");\n \telse if (given_config_file) {\n \t\tif (!is_absolute_path(given_config_file) && prefix)\n-\t\t\tconfig_exclusive_filename =\n+\t\t\tgiven_config_file =\n \t\t\t\txstrdup(prefix_filename(prefix,\n \t\t\t\t\t\t\tstrlen(prefix),\n \t\t\t\t\t\t\tgiven_config_file));\n \t\telse\n-\t\t\tconfig_exclusive_filename = given_config_file;\n+\t\t\tgiven_config_file = given_config_file;\n \t}\n \n \tif (respect_includes == -1)\n-\t\trespect_includes = !config_exclusive_filename;\n+\t\trespect_includes = !given_config_file;\n \n \tif (end_null) {\n \t\tterm = '\\0';\n@@ -438,28 +440,29 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \n \tif (actions == ACTION_LIST) {\n \t\tcheck_argc(argc, 0, 0);\n-\t\tif (git_config(show_all_config, NULL) < 0) {\n-\t\t\tif (config_exclusive_filename)\n+\t\tif (git_config_with_options(show_all_config, NULL,\n+\t\t\t\t\t    given_config_file) < 0) {\n+\t\t\tif (given_config_file)\n \t\t\t\tdie_errno(\"unable to read config file '%s'\",\n-\t\t\t\t\t  config_exclusive_filename);\n+\t\t\t\t\t  given_config_file);\n \t\t\telse\n \t\t\t\tdie(\"error processing config file(s)\");\n \t\t}\n \t}\n \telse if (actions == ACTION_EDIT) {\n \t\tcheck_argc(argc, 0, 0);\n-\t\tif (!config_exclusive_filename && nongit)\n+\t\tif (!given_config_file && nongit)\n \t\t\tdie(\"not in a git directory\");\n \t\tgit_config(git_default_config, NULL);\n-\t\tlaunch_editor(config_exclusive_filename ?\n-\t\t\t      config_exclusive_filename : git_path(\"config\"),\n+\t\tlaunch_editor(given_config_file ?\n+\t\t\t      given_config_file : git_path(\"config\"),\n \t\t\t      NULL, NULL);\n \t}\n \telse if (actions == ACTION_SET) {\n \t\tint ret;\n \t\tcheck_argc(argc, 2, 2);\n \t\tvalue = normalize_value(argv[0], argv[1]);\n-\t\tret = git_config_set(argv[0], value);\n+\t\tret = git_config_set_in_file(given_config_file, argv[0], value);\n \t\tif (ret == CONFIG_NOTHING_SET)\n \t\t\terror(\"cannot overwrite multiple values with a single value\\n\"\n \t\t\t\"       Use a regexp, --add or --replace-all to change %s.\", argv[0]);\n@@ -468,17 +471,20 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \telse if (actions == ACTION_SET_ALL) {\n \t\tcheck_argc(argc, 2, 3);\n \t\tvalue = normalize_value(argv[0], argv[1]);\n-\t\treturn git_config_set_multivar(argv[0], value, argv[2], 0);\n+\t\treturn git_config_set_multivar_in_file(given_config_file,\n+\t\t\t\t\t\t       argv[0], value, argv[2], 0);\n \t}\n \telse if (actions == ACTION_ADD) {\n \t\tcheck_argc(argc, 2, 2);\n \t\tvalue = normalize_value(argv[0], argv[1]);\n-\t\treturn git_config_set_multivar(argv[0], value, \"^$\", 0);\n+\t\treturn git_config_set_multivar_in_file(given_config_file,\n+\t\t\t\t\t\t       argv[0], value, \"^$\", 0);\n \t}\n \telse if (actions == ACTION_REPLACE_ALL) {\n \t\tcheck_argc(argc, 2, 3);\n \t\tvalue = normalize_value(argv[0], argv[1]);\n-\t\treturn git_config_set_multivar(argv[0], value, argv[2], 1);\n+\t\treturn git_config_set_multivar_in_file(given_config_file,\n+\t\t\t\t\t\t       argv[0], value, argv[2], 1);\n \t}\n \telse if (actions == ACTION_GET) {\n \t\tcheck_argc(argc, 1, 2);\n@@ -499,18 +505,22 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \telse if (actions == ACTION_UNSET) {\n \t\tcheck_argc(argc, 1, 2);\n \t\tif (argc == 2)\n-\t\t\treturn git_config_set_multivar(argv[0], NULL, argv[1], 0);\n+\t\t\treturn git_config_set_multivar_in_file(given_config_file,\n+\t\t\t\t\t\t\t       argv[0], NULL, argv[1], 0);\n \t\telse\n-\t\t\treturn git_config_set(argv[0], NULL);\n+\t\t\treturn git_config_set_in_file(given_config_file,\n+\t\t\t\t\t\t      argv[0], NULL);\n \t}\n \telse if (actions == ACTION_UNSET_ALL) {\n \t\tcheck_argc(argc, 1, 2);\n-\t\treturn git_config_set_multivar(argv[0], NULL, argv[1], 1);\n+\t\treturn git_config_set_multivar_in_file(given_config_file,\n+\t\t\t\t\t\t       argv[0], NULL, argv[1], 1);\n \t}\n \telse if (actions == ACTION_RENAME_SECTION) {\n \t\tint ret;\n \t\tcheck_argc(argc, 2, 2);\n-\t\tret = git_config_rename_section(argv[0], argv[1]);\n+\t\tret = git_config_rename_section_in_file(given_config_file,\n+\t\t\t\t\t\t\targv[0], argv[1]);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\n@@ -519,7 +529,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \telse if (actions == ACTION_REMOVE_SECTION) {\n \t\tint ret;\n \t\tcheck_argc(argc, 1, 1);\n-\t\tret = git_config_rename_section(argv[0], NULL);\n+\t\tret = git_config_rename_section_in_file(given_config_file,\n+\t\t\t\t\t\t\targv[0], NULL);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t\tif (ret == 0)\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex 6de46bb..5f249f6 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -458,6 +458,14 @@ test_expect_success 'refer config from subdirectory' '\n \n '\n \n+test_expect_success 'refer config from subdirectory via GIT_CONFIG' '\n+\t(\n+\t\tcd x &&\n+\t\tGIT_CONFIG=../other-config git config --get ein.bahn >actual &&\n+\t\ttest_cmp expect actual\n+\t)\n+'\n+\n cat > expect << EOF\n [ein]\n \tbahn = strasse\n@@ -960,4 +968,21 @@ test_expect_success 'git -c complains about empty key and value' '\n \ttest_must_fail git -c \"\" rev-parse\n '\n \n+test_expect_success 'git config --edit works' '\n+\tgit config -f tmp test.value no &&\n+\techo test.value=yes >expect &&\n+\tGIT_EDITOR=\"echo [test]value=yes >\" git config -f tmp --edit &&\n+\tgit config -f tmp --list >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'git config --edit respects core.editor' '\n+\tgit config -f tmp test.value no &&\n+\techo test.value=yes >expect &&\n+\ttest_config core.editor \"echo [test]value=yes >\" &&\n+\tgit config -f tmp --edit &&\n+\tgit config -f tmp --list >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184813","messageId":"20120216080932.GG11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 7/8] config: eliminate config_exclusive_filename","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:09:32Z","receivedAt":"2012-02-16T08:09:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This is a magic global variable that was intended as an\noverride to the usual git-config lookup process. Once upon a\ntime, you could specify GIT_CONFIG to any git program, and\nit would look only at that file. This turned out to be\nconfusing and cause a lot of bugs for little gain. As a\nresult, dc87183 (Only use GIT_CONFIG in \"git config\", not\nother programs, 2008-06-30) took this away for all callers\nexcept git-config.\n\nSince git-config no longer uses it either, the variable can\njust go away. As the diff shows, nobody was setting to\nanything except NULL, so we can just replace any sites where\nit was read with NULL.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThis could be squashed into the last patch (really, all of the last few\npatches could be squashed). But I was able to \"git grep\nconfig_exclusive_filename\" at this state and see that yes, indeed, the\nvariable is now totally useless.\n\n cache.h  |    2 --\n config.c |   10 +++-------\n 2 files changed, 3 insertions(+), 9 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 7cb8874..411c60d 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1150,8 +1150,6 @@ struct config_include_data {\n #define CONFIG_INCLUDE_INIT { 0 }\n extern int git_config_include(const char *name, const char *value, void *data);\n \n-extern const char *config_exclusive_filename;\n-\n #define MAX_GITNAME (1000)\n extern char git_default_email[MAX_GITNAME];\n extern char git_default_name[MAX_GITNAME];\ndiff --git a/config.c b/config.c\nindex fbf883d..e1d6857 100644\n--- a/config.c\n+++ b/config.c\n@@ -26,8 +26,6 @@ static config_file *cf;\n \n static int zlib_compression_seen;\n \n-const char *config_exclusive_filename = NULL;\n-\n #define MAX_INCLUDE_DEPTH 10\n static const char include_depth_advice[] =\n \"exceeded maximum include depth (%d) while including\\n\"\n@@ -1005,7 +1003,7 @@ int git_config_with_options(config_fn_t fn, void *data,\n \n int git_config(config_fn_t fn, void *data)\n {\n-\treturn git_config_with_options(fn, data, config_exclusive_filename);\n+\treturn git_config_with_options(fn, data, NULL);\n }\n \n /*\n@@ -1504,8 +1502,7 @@ write_err_out:\n int git_config_set_multivar(const char *key, const char *value,\n \t\t\tconst char *value_regex, int multi_replace)\n {\n-\treturn git_config_set_multivar_in_file(config_exclusive_filename,\n-\t\t\t\t\t       key, value, value_regex,\n+\treturn git_config_set_multivar_in_file(NULL, key, value, value_regex,\n \t\t\t\t\t       multi_replace);\n }\n \n@@ -1631,8 +1628,7 @@ out:\n \n int git_config_rename_section(const char *old_name, const char *new_name)\n {\n-\treturn git_config_rename_section_in_file(config_exclusive_filename,\n-\t\t\t\t\t\t old_name, new_name);\n+\treturn git_config_rename_section_in_file(NULL, old_name, new_name);\n }\n \n /*\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184814","messageId":"20120216081001.GH11843@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"[PATCH 8/8] config: do not respect includes for single-file --list","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-16T08:10:01Z","receivedAt":"2012-02-16T08:10:01Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The original include implementation tried not to impact\ncalls to \"git config\" that look at a single file. However,\nsince we called into git_config in a few places (e.g.,\n--list), our respect_includes flag was not supported.\n\nThis patch teaches git_config_with_options a flag to\nrespect includes (instead of doing so by default), and\nteaches git-config to use it.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin/config.c          |    7 ++++---\n cache.h                   |    3 ++-\n config.c                  |   14 ++++++++------\n t/t1305-config-include.sh |    8 ++++++++\n 4 files changed, 22 insertions(+), 10 deletions(-)\n\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 8901dd9..d41a9bf 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -316,7 +316,7 @@ static void get_color(const char *def_color)\n \tget_color_found = 0;\n \tparsed_color[0] = '\\0';\n \tgit_config_with_options(git_get_color_config, NULL,\n-\t\t\t\tgiven_config_file);\n+\t\t\t\tgiven_config_file, respect_includes);\n \n \tif (!get_color_found && def_color)\n \t\tcolor_parse(def_color, \"command line\", parsed_color);\n@@ -344,7 +344,7 @@ static int get_colorbool(int print)\n \tget_colorbool_found = -1;\n \tget_diff_color_found = -1;\n \tgit_config_with_options(git_get_colorbool_config, NULL,\n-\t\t\t\tgiven_config_file);\n+\t\t\t\tgiven_config_file, respect_includes);\n \n \tif (get_colorbool_found < 0) {\n \t\tif (!strcmp(get_colorbool_slot, \"color.diff\"))\n@@ -441,7 +441,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)\n \tif (actions == ACTION_LIST) {\n \t\tcheck_argc(argc, 0, 0);\n \t\tif (git_config_with_options(show_all_config, NULL,\n-\t\t\t\t\t    given_config_file) < 0) {\n+\t\t\t\t\t    given_config_file,\n+\t\t\t\t\t    respect_includes) < 0) {\n \t\t\tif (given_config_file)\n \t\t\t\tdie_errno(\"unable to read config file '%s'\",\n \t\t\t\t\t  given_config_file);\ndiff --git a/cache.h b/cache.h\nindex 411c60d..ff54d6f 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1115,7 +1115,8 @@ extern int git_config_from_file(config_fn_t fn, const char *, void *);\n extern void git_config_push_parameter(const char *text);\n extern int git_config_from_parameters(config_fn_t fn, void *data);\n extern int git_config(config_fn_t fn, void *);\n-extern int git_config_with_options(config_fn_t fn, void *, const char *filename);\n+extern int git_config_with_options(config_fn_t fn, void *,\n+\t\t\t\t   const char *filename, int respect_includes);\n extern int git_config_early(config_fn_t fn, void *, const char *repo_config);\n extern int git_parse_ulong(const char *, unsigned long *);\n extern int git_config_int(const char *, const char *);\ndiff --git a/config.c b/config.c\nindex e1d6857..ad03908 100644\n--- a/config.c\n+++ b/config.c\n@@ -976,16 +976,18 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)\n }\n \n int git_config_with_options(config_fn_t fn, void *data,\n-\t\t\t    const char *filename)\n+\t\t\t    const char *filename, int respect_includes)\n {\n \tchar *repo_config = NULL;\n \tint ret;\n \tstruct config_include_data inc = CONFIG_INCLUDE_INIT;\n \n-\tinc.fn = fn;\n-\tinc.data = data;\n-\tfn = git_config_include;\n-\tdata = &inc;\n+\tif (respect_includes) {\n+\t\tinc.fn = fn;\n+\t\tinc.data = data;\n+\t\tfn = git_config_include;\n+\t\tdata = &inc;\n+\t}\n \n \t/*\n \t * If we have a specific filename, use it. Otherwise, follow the\n@@ -1003,7 +1005,7 @@ int git_config_with_options(config_fn_t fn, void *data,\n \n int git_config(config_fn_t fn, void *data)\n {\n-\treturn git_config_with_options(fn, data, NULL);\n+\treturn git_config_with_options(fn, data, NULL, 1);\n }\n \n /*\ndiff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh\nindex 0a27ec4..f3e03a0 100755\n--- a/t/t1305-config-include.sh\n+++ b/t/t1305-config-include.sh\n@@ -59,6 +59,14 @@ test_expect_success 'single file lookup does not expand includes by default' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success 'single file list does not expand includes by default' '\n+\techo \"[test]one = 1\" >one &&\n+\techo \"[include]path = one\" >.gitconfig &&\n+\techo \"include.path=one\" >expect &&\n+\tgit config -f .gitconfig --list >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success 'writing config file does not expand includes' '\n \techo \"[test]one = 1\" >one &&\n \techo \"[include]path = one\" >.gitconfig &&\n-- \n1.7.9.1.4.g8ffed\n"},{"id":"184834","messageId":"7v1upuzgfr.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":"20120216080102.GA11793@sigill.intra.peff.net","subject":"Re: [PATCH 0/8] config-include fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-16T20:11:52Z","receivedAt":"2012-02-16T20:11:52Z","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> I prepared this on top of what you have queued in jk/config-include.\n> However, all of the cleanup is semantically independent of the topic\n> (though there are a few minor textual conflicts). If I were re-rolling,\n> I would put it all at the front, then squash patch 8 into my prior\n> \"implement config includes\" patch.\n\nSorry for being late in answering the \"revert or build on top\" question; I\nwas mostly offline yesterday afternoon.\n\n>   [7/8]: config: eliminate config_exclusive_filename\n>\n> This is all cleanup which makes config_exclusive_filename go away. It's\n> not strictly necessary for this series, but it's something I've been\n> wanting to clean up for a while. And it does fix a few minor bugs (see\n> patch 6/8). And the refactoring in 5/8 lays the groundwork for 8/8.\n>\n>   [8/8]: config: do not respect includes for single-file --list\n>\n> The actual fix for the regression in my config-include patch.\n\nThanks.\n\nLooking at the rebased result, it strikes me that with_options version\n\n    Furthermore, by providing a more \"advanced\" interface, we\n    now have a a natural place to add new options for callers\n    like git-config, which care about tweaking the specifics of\n    config lookup, without disturbing the large number of\n    \"simple\" users (i.e., every other part of git).\n\nperhaps wants to get a pointer to struct config_lookup_options, instead of\nus having to add a new parameter to all callsites every time a new need\nis discovered.\n"},{"id":"184855","messageId":"20120217001438.GD4756@sigill.intra.peff.net","threadId":"29617","inReplyTo":"7v1upuzgfr.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/8] config-include fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T00:14:38Z","receivedAt":"2012-02-17T00:14:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 16, 2012 at 12:11:52PM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > I prepared this on top of what you have queued in jk/config-include.\n> > However, all of the cleanup is semantically independent of the topic\n> > (though there are a few minor textual conflicts). If I were re-rolling,\n> > I would put it all at the front, then squash patch 8 into my prior\n> > \"implement config includes\" patch.\n> \n> Sorry for being late in answering the \"revert or build on top\" question; I\n> was mostly offline yesterday afternoon.\n\nNo problem. I did it as build-on-top because it's much easier to squash\nand reorder the commits later than it is to pick a re-roll apart into\nmultiple commits.\n\nWhich way did you want me to go with it?\n\n> Looking at the rebased result, it strikes me that with_options version\n> \n>     Furthermore, by providing a more \"advanced\" interface, we\n>     now have a a natural place to add new options for callers\n>     like git-config, which care about tweaking the specifics of\n>     config lookup, without disturbing the large number of\n>     \"simple\" users (i.e., every other part of git).\n> \n> perhaps wants to get a pointer to struct config_lookup_options, instead of\n> us having to add a new parameter to all callsites every time a new need\n> is discovered.\n\nI considered that, but I noticed that the only callers who are really\ngoing to care about the _with_options version will be in\nbuiltin/config.c, and they all care about every option. And dealing with\ncreating a struct for each call seemed like more hassle.\n\nOTOH, I could probably just make a single static global\nconfig_lookup_options, and have all of the option parsing tweak it\ndirectly (i.e., replace the given_config_file and respect_includes\nstatic globals).\n\n-Peff\n"},{"id":"184860","messageId":"7vty2quq9r.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":"20120217001438.GD4756@sigill.intra.peff.net","subject":"Re: [PATCH 0/8] config-include fixes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-17T02:50:40Z","receivedAt":"2012-02-17T02:50: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> On Thu, Feb 16, 2012 at 12:11:52PM -0800, Junio C Hamano wrote:\n>\n>> Jeff King <peff@peff.net> writes:\n>> \n>> > I prepared this on top of what you have queued in jk/config-include.\n>> > However, all of the cleanup is semantically independent of the topic\n>> > (though there are a few minor textual conflicts). If I were re-rolling,\n>> > I would put it all at the front, then squash patch 8 into my prior\n>> > \"implement config includes\" patch.\n>> \n>> Sorry for being late in answering the \"revert or build on top\" question; I\n>> was mostly offline yesterday afternoon.\n>\n> No problem. I did it as build-on-top because it's much easier to squash\n> and reorder the commits later than it is to pick a re-roll apart into\n> multiple commits.\n>\n> Which way did you want me to go with it?\n\nI'll push out the re-roll that follows your outline above in 'pu'; I think\nI got all the conflict resolved correctly, but please eyeball the result.\n\n>> Looking at the rebased result, it strikes me that with_options version\n>> \n>>     Furthermore, by providing a more \"advanced\" interface, we\n>>     now have a a natural place to add new options for callers\n>>     like git-config, which care about tweaking the specifics of\n>>     config lookup, without disturbing the large number of\n>>     \"simple\" users (i.e., every other part of git).\n>> \n>> perhaps wants to get a pointer to struct config_lookup_options, instead of\n>> us having to add a new parameter to all callsites every time a new need\n>> is discovered.\n>\n> I considered that, but I noticed that the only callers who are really\n> going to care about the _with_options version will be in\n> builtin/config.c, and they all care about every option.\n\nOk.\n\nThanks.\n"},{"id":"184861","messageId":"20120217031723.GA5738@sigill.intra.peff.net","threadId":"29617","inReplyTo":"7vty2quq9r.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/8] config-include fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T03:17:23Z","receivedAt":"2012-02-17T03:17:23Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 16, 2012 at 06:50:40PM -0800, Junio C Hamano wrote:\n\n> I'll push out the re-roll that follows your outline above in 'pu'; I think\n> I got all the conflict resolved correctly, but please eyeball the result.\n\nWill do.\n\nSince you are re-rolling, these are the documentation fixes I had\nsquashed in based on your earlier review (though come to think of it,\nthe new patches should now also describe `git_config_with_options`).\n\n---\ndiff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt\nindex f428c5c..01f64d1 100644\n--- a/Documentation/technical/api-config.txt\n+++ b/Documentation/technical/api-config.txt\n@@ -11,9 +11,9 @@ General Usage\n Config files are parsed linearly, and each variable found is passed to a\n caller-provided callback function. The callback function is responsible\n for any actions to be taken on the config option, and is free to ignore\n-some options (it is not uncommon for the configuration to be parsed\n+some options. It is not uncommon for the configuration to be parsed\n several times during the run of a git program, with different callbacks\n-picking out different variables useful to themselves).\n+picking out different variables useful to themselves.\n \n A config callback function takes three parameters:\n \n@@ -47,11 +47,12 @@ will first feed the user-wide one to the callback, and then the\n repo-specific one; by overwriting, the higher-priority repo-specific\n value is left at the end).\n \n-There is a special version of `git_config` called `git_config_early`\n-that takes an additional parameter to specify the repository config.\n-This should be used early in a git program when the repository location\n-has not yet been determined (and calling the usual lazy-evaluation\n-lookup rules would yield an incorrect location).\n+There is a special version of `git_config` called `git_config_early`.\n+This version takes an additional parameter to specify the repository\n+config, instead of having it looked up via `git_path`. This is useful\n+early in a git program before the repository has been found. Unless\n+you're working with early setup code, you probably don't want to use\n+this.\n \n Reading Specific Files\n ----------------------\n"},{"id":"184862","messageId":"20120217032325.GB5738@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120217031723.GA5738@sigill.intra.peff.net","subject":"Re: [PATCH 0/8] config-include fixes","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T03:23:25Z","receivedAt":"2012-02-17T03:23:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 16, 2012 at 10:17:23PM -0500, Jeff King wrote:\n\n> On Thu, Feb 16, 2012 at 06:50:40PM -0800, Junio C Hamano wrote:\n> \n> > I'll push out the re-roll that follows your outline above in 'pu'; I think\n> > I got all the conflict resolved correctly, but please eyeball the result.\n> \n> Will do.\n\nI see you just pushed it out. The result looks good to me.\n\n> Since you are re-rolling, these are the documentation fixes I had\n> squashed in based on your earlier review (though come to think of it,\n> the new patches should now also describe `git_config_with_options`).\n\nLooks like you just reverted the \"include\" patch instead of the merge of\nthe whole topic.  I'll prepare a few documentation fixups on top, then.\n\n-Peff\n"},{"id":"184876","messageId":"20120217081743.GA11389@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120217032325.GB5738@sigill.intra.peff.net","subject":"[PATCH 0/2] api-config documentation leftovers","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T08:17:43Z","receivedAt":"2012-02-17T08:17:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Feb 16, 2012 at 10:23:25PM -0500, Jeff King wrote:\n\n> > Since you are re-rolling, these are the documentation fixes I had\n> > squashed in based on your earlier review (though come to think of it,\n> > the new patches should now also describe `git_config_with_options`).\n> \n> Looks like you just reverted the \"include\" patch instead of the merge of\n> the whole topic.  I'll prepare a few documentation fixups on top, then.\n\nHere they are, on top of what you have in jk/config-include. Squashing\nwould involve breaking apart the second one into the \"introduce\ngit_config_with_options\" part and the \"and now it learns\nrespect_includes\" part. So it's probably not worth the effort.\n\n  [1/2]: docs/api-config: minor clarifications\n  [2/2]: docs/api-config: describe git_config_with_options\n\n-Peff\n"},{"id":"184879","messageId":"20120217081838.GA11418@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120217032325.GB5738@sigill.intra.peff.net","subject":"[PATCH 1/2] docs/api-config: minor clarifications","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T08:18:38Z","receivedAt":"2012-02-17T08:18:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The first change simply drops some parentheses to make a\nstatement more clear. The seconds clarifies that almost\nnobody wants to call git_config_early.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/technical/api-config.txt |   15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt\nindex c60b6b3..67984da 100644\n--- a/Documentation/technical/api-config.txt\n+++ b/Documentation/technical/api-config.txt\n@@ -11,9 +11,9 @@ General Usage\n Config files are parsed linearly, and each variable found is passed to a\n caller-provided callback function. The callback function is responsible\n for any actions to be taken on the config option, and is free to ignore\n-some options (it is not uncommon for the configuration to be parsed\n+some options. It is not uncommon for the configuration to be parsed\n several times during the run of a git program, with different callbacks\n-picking out different variables useful to themselves).\n+picking out different variables useful to themselves.\n \n A config callback function takes three parameters:\n \n@@ -47,11 +47,12 @@ will first feed the user-wide one to the callback, and then the\n repo-specific one; by overwriting, the higher-priority repo-specific\n value is left at the end).\n \n-There is a special version of `git_config` called `git_config_early`\n-that takes an additional parameter to specify the repository config.\n-This should be used early in a git program when the repository location\n-has not yet been determined (and calling the usual lazy-evaluation\n-lookup rules would yield an incorrect location).\n+There is a special version of `git_config` called `git_config_early`.\n+This version takes an additional parameter to specify the repository\n+config, instead of having it looked up via `git_path`. This is useful\n+early in a git program before the repository has been found. Unless\n+you're working with early setup code, you probably don't want to use\n+this.\n \n Reading Specific Files\n ----------------------\n-- \n1.7.9.9.gcf58\n"},{"id":"184878","messageId":"20120217081845.GB11418@sigill.intra.peff.net","threadId":"29617","inReplyTo":"20120217032325.GB5738@sigill.intra.peff.net","subject":"[PATCH 2/2] docs/api-config: describe git_config_with_options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-17T08:18:45Z","receivedAt":"2012-02-17T08:18:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"This function was added recently but not documented.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n Documentation/technical/api-config.txt |   16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/Documentation/technical/api-config.txt b/Documentation/technical/api-config.txt\nindex 67984da..3dbf9fd 100644\n--- a/Documentation/technical/api-config.txt\n+++ b/Documentation/technical/api-config.txt\n@@ -47,6 +47,22 @@ will first feed the user-wide one to the callback, and then the\n repo-specific one; by overwriting, the higher-priority repo-specific\n value is left at the end).\n \n+The `git_config_with_options` function lets the caller examine config\n+while adjusting some of the default behavior of `git_config`. It should\n+almost never be used by \"regular\" git code that is looking up\n+configuration variables. It is intended for advanced callers like\n+`git-config`, which are intentionally tweaking the normal config-lookup\n+process. It takes two options:\n+\n+`filename`::\n+If this parameter is non-NULL, it specifies the name of a file to\n+parse for configuration, rather than looking in the usual files. Regular\n+`git_config` defaults to `NULL`.\n+\n+`respect_includes`::\n+Specify whether include directives should be followed in parsed files.\n+Regular `git_config` defaults to `1`.\n+\n There is a special version of `git_config` called `git_config_early`.\n This version takes an additional parameter to specify the repository\n config, instead of having it looked up via `git_path`. This is useful\n-- \n1.7.9.9.gcf58\n"},{"id":"184890","messageId":"7v1uptv1ba.fsf@alter.siamese.dyndns.org","threadId":"29617","inReplyTo":"20120217081743.GA11389@sigill.intra.peff.net","subject":"Re: [PATCH 0/2] api-config documentation leftovers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-17T17:04:25Z","receivedAt":"2012-02-17T17:04:25Z","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> Here they are, on top of what you have in jk/config-include. Squashing\n> would involve breaking apart the second one into the \"introduce\n> git_config_with_options\" part and the \"and now it learns\n> respect_includes\" part. So it's probably not worth the effort.\n>\n>   [1/2]: docs/api-config: minor clarifications\n>   [2/2]: docs/api-config: describe git_config_with_options\n\nThanks.\n"}]}