{"thread":{"id":"23167","subject":"What's cooking in git.git (Mar 2010, #06; Wed, 24)","startedAt":"2010-03-25T00:41:16Z","lastAt":"2010-03-29T18:17:35Z","messageCount":13,"participants":["Junio C Hamano","Nguyen Thai Ngoc Duy","Brandon Casey","Alex Riesen","Ben Walton","Ian Ward Comfort","Julian Phillips"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137756","messageId":"7v7hp1kzbn.fsf@alter.siamese.dyndns.org","threadId":"23167","inReplyTo":null,"subject":"What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-25T00:41:16Z","receivedAt":"2010-03-25T00:41:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"What's cooking in git.git (Mar 2010, #06; Wed, 24)\n--------------------------------------------------\n\nHere are the topics that have been cooking.  Commits prefixed with '-' are\nonly in 'pu' while commits prefixed with '+' are in 'next'.  The ones\nmarked with '.' do not appear in any of the integration branches, but I am\nstill holding onto them.\n\nThe tip of 'pu' is broken right now; it does not pass t7006.\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* jh/maint-submodule-status-in-void (2010-03-09) 2 commits\n  (merged to 'next' on 2010-03-15 at 49af9de)\n + git submodule summary: Handle HEAD as argument when on an unborn branch\n  (merged to 'next' on 2010-03-08 at 0697bf4)\n + submodule summary: do not fail before the first commit\n\n* jc/maint-refs-dangling (2010-03-15) 1 commit\n  (merged to 'next' on 2010-03-16 at 376027b)\n + refs: ref entry with NULL sha1 is can be a dangling symref\n\n* pb/log-first-parent-p-m (2010-03-09) 5 commits\n  (merged to 'next' on 2010-03-15 at 0ae494e)\n + show --first-parent/-m: do not default to --cc\n + show -c: show patch text\n + revision: introduce setup_revision_opt\n + t4013: add tests for log -p -m --first-parent\n  (merged to 'next' on 2010-02-17 at 2f8e5ae)\n + git log -p -m: document -m and honor --first-parent\n\nReady for 'master'.\n\n* jl/submodule-diff-dirtiness (2010-03-13) 5 commits\n  (merged to 'next' on 2010-03-15 at 9601fd9)\n + git status: ignoring untracked files must apply to submodules too\n  (merged to 'next' on 2010-03-13 at f9bfd8a)\n + git status: Fix false positive \"new commits\" output for dirty submodules\n + Refactor dirty submodule detection in diff-lib.c\n  (merged to 'next' on 2010-03-08 at 33f7a57)\n + git status: Show detailed dirty status of submodules in long format\n  (merged to 'next' on 2010-03-04 at 58b2645)\n + git diff --submodule: Show detailed dirty status of submodules\n\nReady for 'master'.\n\n* tr/notes-display (2010-03-12) 13 commits\n  (merged to 'next' on 2010-03-15 at 3329361)\n + git-notes(1): add a section about the meaning of history\n + notes: track whether notes_trees were changed at all\n + notes: add shorthand --ref to override GIT_NOTES_REF\n + commit --amend: copy notes to the new commit\n + rebase: support automatic notes copying\n + notes: implement helpers needed for note copying during rewrite\n + notes: implement 'git notes copy --stdin'\n + rebase -i: invoke post-rewrite hook\n + rebase: invoke post-rewrite hook\n + commit --amend: invoke post-rewrite hook\n + Documentation: document post-rewrite hook\n + Support showing notes from more than one notes tree\n + test-lib: unset GIT_NOTES_REF to stop it from influencing tests\n (this branch is used by sb/notes-parse-opt.)\n\n--------------------------------------------------\n[New Topics]\n\n* bw/git-completion-rpmspec (2010-03-20) 1 commit\n - Add a git-completion rpm subpackage to the spec\n\nShipping bash-completion as part of RPM package; since Todd Zullinger who\npackages git for Fedora joined the thread, I am hoping that I can defer\nthe direction of the final version to the discussion between Todd and Ben.\n\n* ef/maint-empty-commit-log (2010-03-21) 1 commit\n - rev-list: fix --pretty=oneline with empty message\n\nLooked reasonable.  Soon in 'next'.\n\n* em/checkout-orphan (2010-03-21) 1 commit\n - git checkout: create unparented branch by --orphan\n\nLooked reasonable, except that we might want to come up with a way to\nallow people with core.logallrefupdates set to false to still override it\nwith \"-l\" when switching to this new branch.  Or we may not care.  I dunno.\n\nSoon in 'next'.\n\n* mg/mailmap-update (2010-03-19) 1 commit\n - .mailmap: Entries for Alex Benn辿e, Deskin Miller, Vitaly \"_Vi\" Shukela\n\nSoon in 'next'.\n\n* mg/maint-send-email-lazy-editor (2010-03-22) 1 commit\n - [reword?] send-email: lazily assign editor variable\n\n* mg/use-default-abbrev-length-in-rev-list (2010-03-22) 1 commit\n - rev-list: use default abbrev length when abbrev-commit is in effect\n\n* np/malloc-threading (2010-03-24) 1 commit\n - Make xmalloc and xrealloc thread-safe\n\n* rb/maint-python-path (2010-03-21) 1 commit\n - Correct references to /usr/bin/python which does not exist on FreeBSD\n\nSoon in 'next'.\n\n* rr/imap-send-unconfuse-from-line (2010-03-22) 1 commit\n - imap-send: Remove limitation on message body\n\nSoon in 'next'.\n\n* sp/maint-http-backend-die-triggers-die-recursively (2010-03-22) 1 commit\n - http-backend: Don't infinite loop during die()\n\nSoon in 'next'.\n\n--------------------------------------------------\n[Stalled]\n\n* cw/test-lib-relicense (2010-02-22) 1 commit\n . test-lib.sh: Add explicit license detail, with change from GPLv2 to GPLv2+.\n\nAck-collection stopped at the last three names.  I am hoping Carl can take\nit from there without my keeping an eye on it.\n\n* js/rebase-origin-x (2010-02-05) 1 commit\n - [RFC w/o test and incomplete] rebase: add -x option to record original commit name\n\nI retract my objection against the idea of -x; needs polishing before\nmoving forward.\n\n* sg/bash-completion (2010-02-23) 4 commits\n  (merged to 'next' on 2010-03-08 at bc59860)\n + bash: completion for gitk aliases\n + bash: support user-supplied completion scripts for aliases\n + bash: support user-supplied completion scripts for user's git commands\n + bash: improve aliased command recognition\n\nPerhaps rename _git_frotz -> _git_complete_frotz?  I dunno.\n\n* sd/log-decorate (2010-02-17) 3 commits\n  (merged to 'next' on 2010-03-08 at 58a6fba)\n + log.decorate: usability fixes\n + Add `log.decorate' configuration variable.\n + git_config_maybe_bool()\n\nNeeds squelching the configuration setting when \"--pretty=raw\" is given,\nat least, or possibly when any \"--pretty\" is explicitly given.\n\n--------------------------------------------------\n[Cooking]\n\n* ar/config-from-command-line (2010-03-19) 1 commit\n - Allow passing of configuration parameters in the command line\n\n* bc/t5505-fix (2010-03-19) 3 commits\n - t/t5505-remote.sh: escape * to prevent interpretation by shell as glob\n - t5505: add missing &&\n - t5505: remove unnecessary subshell invocations\n\nLooked reasonable.  Soon in 'next'.\n\n* bw/template-tool-buildconfig (2010-03-20) 2 commits\n - Modernize git calling conventions in hook templates\n - Make templates honour SHELL_PATH and PERL_PATH\n\nLooked reasonable.  Soon in 'next'.\n\n* mb/rebase-i-no-ff (2010-03-24) 1 commit\n - Teach rebase the --no-ff option.\n\nLooked reasonable.  Soon in 'next'.\n\n* jn/merge-diff3-label (2010-03-20) 14 commits\n  (merged to 'next' on 2010-03-20 at 26f1805)\n + merge-recursive: add a label for ancestor\n + cherry-pick, revert: add a label for ancestor\n + revert: clarify label on conflict hunks\n + compat: add mempcpy()\n + checkout -m --conflict=diff3: add a label for ancestor\n + merge_trees(): add ancestor label parameter for diff3-style output\n + merge_file(): add comment explaining behavior wrt conflict style\n + checkout --conflict=diff3: add a label for ancestor\n + ll_merge(): add ancestor label parameter for diff3-style output\n + merge-file --diff3: add a label for ancestor\n + xdl_merge(): move file1 and file2 labels to xmparam structure\n + xdl_merge(): add optional ancestor label to diff3-style output\n + tests: document cherry-pick behavior in face of conflicts\n + tests: document format of conflicts from checkout -m\n\n* do/rebase-i-arbitrary (2010-03-14) 1 commit\n - rebase--interactive: don't require what's rebased to be a branch\n\nLooked reasonable.  Soon in 'next'.\n\n* ja/send-email-ehlo (2010-03-14) 3 commits\n - git-send-email.perl - try to give real name of the calling host to HELO/EHLO\n - git-send-email.perl: add option --smtp-debug\n - git-send-email.perl: improve error message in send_message()\n\nLooked reasonable.  Soon in 'next'.\n\n* ak/everyday-git (2009-10-21) 1 commit\n - everyday: fsck and gc are not everyday operations\n\nLooked reasonable.  Soon in 'next'.\n\n* bc/acl-test (2010-03-15) 5 commits\n - t/t1304: make a second colon optional in the mask ACL check\n - t/t1304: set the ACL effective rights mask\n - t/t1304: use 'test -r' to test readability rather than looking at mode bits\n - t/t1304: set the Default ACL base entries\n - t/t1304: avoid -d option to setfacl\n\nLooked reasonable.  Soon in 'next'.\n\n* bc/maint-daemon-sans-ss-family (2010-03-15) 1 commit\n - daemon.c: avoid accessing ss_family member of struct sockaddr_storage\n\nLooked reasonable.  Soon in 'next'.\n\n* ef/cherry-abbrev (2010-03-20) 2 commits\n - ls: remove redundant logic\n - cherry: support --abbrev option\n\nLooked reasonable.  Soon in 'next'.\n\n* gh/maint-stash-show-error-message (2010-03-16) 1 commit\n - Improve error messages from 'git stash show'\n\nLooked reasonable.  Soon in 'next'.\n\n* rs/threaded-grep-context (2010-03-15) 1 commit\n - grep: enable threading for context line printing\n\nLooked reasonable.  Soon in 'next'.\n\n* cc/cherry-pick-ff (2010-03-20) 7 commits\n  (merged to 'next' on 2010-03-20 at a1ae16b)\n + revert: fix tiny memory leak in cherry-pick --ff\n + rebase -i: use new --ff cherry-pick option\n  (merged to 'next' on 2010-03-07 at 5589b26)\n + Documentation: describe new cherry-pick --ff option\n + cherry-pick: add tests for new --ff option\n + revert: add --ff option to allow fast forward when cherry-picking\n + builtin/merge: make checkout_fast_forward() non static\n + parse-options: add parse_options_concat() to concat options\n\nReady for 'master'.\n\n* js/async-thread (2010-03-09) 7 commits\n - Enable threaded async procedures whenever pthreads is available\n  (merged to 'next' on 2010-03-20 at 9939243)\n + Dying in an async procedure should only exit the thread, not the process.\n + Reimplement async procedures using pthreads\n + Windows: more pthreads functions\n + Fix signature of fcntl() compatibility dummy\n + Make report() from usage.c public as vreportf() and use it.\n + Modernize t5530-upload-pack-error.\n\nThe tip one will be soon in 'next', but one step at a time.\n\n* nd/setup (2010-03-21) 40 commits\n - Guard unallowed access to repository when it's not set up\n - alias: keep repository found while collecting aliases as long as possible\n - Allow to undo setup_git_directory_gently() gracefully (and fix alias code)\n - builtins: check for startup_info->help, print and exit early\n - builtins: utilize startup_info->help where possible\n - run_builtin(): save \"-h\" detection result for later use\n - config: do not read .git/config if there is no repository\n - apply: do not check sha1 when repository has not been found\n - Do not read .git/info/attributes if there is no repository\n - Do not read .git/info/exclude if there is no repository\n - git_config(): do not read .git/config if there is no repository\n - init/clone: turn on startup->have_repository properly\n - worktree setup: restore original state when things go wrong\n - Use git_config_early() instead of git_config() during repo setup\n - Add git_config_early()\n - worktree setup: call set_git_dir explicitly\n - rev-parse --git-dir: print relative gitdir correctly\n - enter_repo(): initialize other variables as setup_git_directory_gently() does\n - Move enter_repo() to setup.c\n - index-pack: use RUN_SETUP_GENTLY\n - index-pack: trust the prefix returned by setup_git_directory_gently()\n - worktree setup: calculate prefix even if no worktree is found\n - merge-file: use RUN_SETUP_GENTLY\n - var: use RUN_SETUP_GENTLY\n - ls-remote: use RUN_SETUP_GENTLY\n - help: use RUN_SETUP_GENTLY\n - diff: use RUN_SETUP_GENTLY\n - bundle: use RUN_SETUP_GENTLY\n - apply: use RUN_SETUP_GENTLY\n - verify-pack: use RUN_SETUP_GENTLY\n - check-ref-format: use RUN_SETUP_GENTLY\n - mailinfo: use RUN_SETUP_GENTLY\n - archive: use RUN_SETUP_GENTLY\n - builtin: USE_PAGER should not be used without RUN_SETUP*\n - grep: use RUN_SETUP_GENTLY\n - shortlog: use RUN_SETUP_GENTLY\n - hash-object: use RUN_SETUP_GENTLY\n - config: use RUN_SETUP_GENTLY\n - builtin: Support RUN_SETUP_GENTLY to set up repository early if found\n - builtin: introduce startup_info struct\n\nThis seems to break t7006 when merged to 'pu'.\n\n* sb/notes-parse-opt (2010-02-27) 1 commit\n  (merged to 'next' on 2010-03-24 at 82eebc1)\n + notes: rework subcommands and parse options\n"},{"id":"137799","messageId":"fcaeb9bf1003250811g777b2881l332e6f61456d699@mail.gmail.com","threadId":"23167","inReplyTo":"7v7hp1kzbn.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-03-25T15:11:15Z","receivedAt":"2010-03-25T15:11:15Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2010/3/25 Junio C Hamano <gitster@pobox.com>:\n> * ar/config-from-command-line (2010-03-19) 1 commit\n>  - Allow passing of configuration parameters in the command line\n>\n> * bc/t5505-fix (2010-03-19) 3 commits\n>  - t/t5505-remote.sh: escape * to prevent interpretation by shell as glob\n>  - t5505: add missing &&\n>  - t5505: remove unnecessary subshell invocations\n\nThis breaks my build on Solaris because it uses strndup, which is not available.\n-- \nDuy\n"},{"id":"137800","messageId":"fcaeb9bf1003250816r16b06b1es6030b4fb8ae0a6de@mail.gmail.com","threadId":"23167","inReplyTo":"7v7hp1kzbn.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-03-25T15:16:55Z","receivedAt":"2010-03-25T15:16:55Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"2010/3/25 Junio C Hamano <gitster@pobox.com>:\n> * nd/setup (2010-03-21) 40 commits\n>  - Guard unallowed access to repository when it's not set up\n>  - alias: keep repository found while collecting aliases as long as possible\n>  - Allow to undo setup_git_directory_gently() gracefully (and fix alias code)\n>  - builtins: check for startup_info->help, print and exit early\n>  - builtins: utilize startup_info->help where possible\n>  - run_builtin(): save \"-h\" detection result for later use\n>  - config: do not read .git/config if there is no repository\n>  - apply: do not check sha1 when repository has not been found\n>  - Do not read .git/info/attributes if there is no repository\n>  - Do not read .git/info/exclude if there is no repository\n>  - git_config(): do not read .git/config if there is no repository\n>  - init/clone: turn on startup->have_repository properly\n>  - worktree setup: restore original state when things go wrong\n>  - Use git_config_early() instead of git_config() during repo setup\n>  - Add git_config_early()\n>  - worktree setup: call set_git_dir explicitly\n>  - rev-parse --git-dir: print relative gitdir correctly\n>  - enter_repo(): initialize other variables as setup_git_directory_gently() does\n>  - Move enter_repo() to setup.c\n>  - index-pack: use RUN_SETUP_GENTLY\n>  - index-pack: trust the prefix returned by setup_git_directory_gently()\n>  - worktree setup: calculate prefix even if no worktree is found\n>  - merge-file: use RUN_SETUP_GENTLY\n>  - var: use RUN_SETUP_GENTLY\n>  - ls-remote: use RUN_SETUP_GENTLY\n>  - help: use RUN_SETUP_GENTLY\n>  - diff: use RUN_SETUP_GENTLY\n>  - bundle: use RUN_SETUP_GENTLY\n>  - apply: use RUN_SETUP_GENTLY\n>  - verify-pack: use RUN_SETUP_GENTLY\n>  - check-ref-format: use RUN_SETUP_GENTLY\n>  - mailinfo: use RUN_SETUP_GENTLY\n>  - archive: use RUN_SETUP_GENTLY\n>  - builtin: USE_PAGER should not be used without RUN_SETUP*\n>  - grep: use RUN_SETUP_GENTLY\n>  - shortlog: use RUN_SETUP_GENTLY\n>  - hash-object: use RUN_SETUP_GENTLY\n>  - config: use RUN_SETUP_GENTLY\n>  - builtin: Support RUN_SETUP_GENTLY to set up repository early if found\n>  - builtin: introduce startup_info struct\n>\n> This seems to break t7006 when merged to 'pu'.\n\nUnfortunately that test does not break on my machine (b745e293f).\nt9100 breaks though. I´m looking into it.\n\nCan you send me ¨./t7006-* -v¨ output? If you have free time\n(unlikely), and the output says ¨internal error: access to .git/config\nwithout repo setup¨ or ¨internal error: setup_git_env can´t be called\ntwice¨, can you run gdb and give me the stack trace when it die()? I\ncould have missed some code path.\n-- \nDuy\n"},{"id":"137813","messageId":"25yNvbuAivZlBuEJoRhXtfoEc7HEZorM5qOrwgQKk7FER_fdzljyMQ@cipher.nrlssc.navy.mil","threadId":"23167","inReplyTo":"fcaeb9bf1003250811g777b2881l332e6f61456d699@mail.gmail.com","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-03-25T16:27:33Z","receivedAt":"2010-03-25T16:27:33Z","isPatch":false,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 03/25/2010 10:11 AM, Nguyen Thai Ngoc Duy wrote:\n> 2010/3/25 Junio C Hamano <gitster@pobox.com>:\n>> * ar/config-from-command-line (2010-03-19) 1 commit\n>>  - Allow passing of configuration parameters in the command line\n>>\n>> * bc/t5505-fix (2010-03-19) 3 commits\n>>  - t/t5505-remote.sh: escape * to prevent interpretation by shell as glob\n>>  - t5505: add missing &&\n>>  - t5505: remove unnecessary subshell invocations\n\nmethinks you were over-aggressive with your cut/paste?  I don't think bc/t5505-fix\ncontains a strndup.  Hopefully, it does not break your build on Solaris.\n\n> This breaks my build on Solaris because it uses strndup, which is not available.\n\nA quick glance at ar/config-from.. also detected an unchecked calloc().\n\nAlex, any reason xcalloc wasn't used?\n\nbtw, me also thinks the code is a little hard to read.  For example, I initially\nthought your calloc was not allocating enough space for the nul terminator.\n\n   ct = calloc(1, sizeof(struct config_item) + (text - name));\n   memcpy(ct->name, name, text - name);\n\nI traced the code, but it wasn't until I noticed that your data structure looks\nlike this:\n\n   struct config_item\n   {\n          struct config_item *next;\n          char *value;\n          char name[1];\n   };\n\nthat I realized that room for the nul terminator in the 'name' array was allocated\nby the structure itself, since the name declaration looks like name[1] and not\nname[FLEX_ARRAY].\n\nWould the code be simpler if strbufs were used?  Then you wouldn't need to duplicate\nthe skip_space and trailing_space functionality provided in the strbuf library, and\nwould just need a new function named strbuf_tolower.\n\nAlso, should config_parametes_tail be spelled config_parameters_tail?\n\n-brandon\n"},{"id":"137817","messageId":"81b0412b1003251611h62222eabw247ec59678c198ad@mail.gmail.com","threadId":"23167","inReplyTo":"25yNvbuAivZlBuEJoRhXtfoEc7HEZorM5qOrwgQKk7FER_fdzljyMQ@cipher.nrlssc.navy.mil","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-25T23:11:51Z","receivedAt":"2010-03-25T23:11:51Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Thu, Mar 25, 2010 at 17:27, Brandon Casey\n<brandon.casey.ctr@nrlssc.navy.mil> wrote:\n> On 03/25/2010 10:11 AM, Nguyen Thai Ngoc Duy wrote:\n>> 2010/3/25 Junio C Hamano <gitster@pobox.com>:\n>>> * ar/config-from-command-line (2010-03-19) 1 commit\n>>>  - Allow passing of configuration parameters in the command line\n>> This breaks my build on Solaris because it uses strndup, which is not available.\n>\n> A quick glance at ar/config-from.. also detected an unchecked calloc().\n>\n> Alex, any reason xcalloc wasn't used?\n\nJust missed it. Long time away from Git sources.\n\n> btw, me also thinks the code is a little hard to read.  For example, I initially\n> thought your calloc was not allocating enough space for the nul terminator.\n>\n>   ct = calloc(1, sizeof(struct config_item) + (text - name));\n>   memcpy(ct->name, name, text - name);\n>\n> I traced the code, but it wasn't until I noticed that your data structure looks\n> like this:\n>\n>   struct config_item\n>   {\n>          struct config_item *next;\n>          char *value;\n>          char name[1];\n>   };\n>\n> that I realized that room for the nul terminator in the 'name' array was allocated\n> by the structure itself, since the name declaration looks like name[1] and not\n> name[FLEX_ARRAY].\n\nHmm, I kinda liked how the space for the terminator was reserved and\nall the flex array incompatibilities were worked around.\n\n> Would the code be simpler if strbufs were used?  Then you wouldn't need to duplicate\n> the skip_space and trailing_space functionality provided in the strbuf library, and\n> would just need a new function named strbuf_tolower.\n\nBut this indeed makes sense. Promise to take a look at it after some sleep.\n\n> Also, should config_parametes_tail be spelled config_parameters_tail?\n\nYep.\n\nThanks!\n"},{"id":"137822","messageId":"1269569690-sup-4884@pinkfloyd.chass.utoronto.ca","threadId":"23167","inReplyTo":"7v7hp1kzbn.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2010-03-26T02:19:14Z","receivedAt":"2010-03-26T02:19:14Z","isPatch":false,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Junio C Hamano's message of Wed Mar 24 20:41:16 -0400 2010:\n\n> * bw/git-completion-rpmspec (2010-03-20) 1 commit\n>  - Add a git-completion rpm subpackage to the spec\n> \n> Shipping bash-completion as part of RPM package; since Todd\n> Zullinger who packages git for Fedora joined the thread, I am hoping\n> that I can defer the direction of the final version to the\n> discussion between Todd and Ben.\n\nI think Todd made a good case for making this part of the core git\nrpm.  Ian's patch would be more suited for inclusion in this case.\nThe remaining question is whether to stick it in\n/etc/bash_completion.d or in /usr/share/bash_completion.d (the\ntriggers vs direct bit).\n\nThe closer the core spec file is to the one that distro's use, the\nbetter.  This is a reciprocal benefit, I think.\n\nI'm still interested in Todd's (and anyone else') thoughts about\nadding the git-daemon, etc, sub-packages as part of the stock spec\nfile.  Are they too distro specific for inclusion?  (eg: which user\nshould run git-daemon[1]?  default repo/cgi location for gitweb?)\n\nThanks\n-Ben\n\n[1] The fedora spec sees git-daemon run as 'nobody' but imho, this isn't\n    a good choice.  A separate 'git' user would be my preference.\n-- \nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"137826","messageId":"fcaeb9bf1003252247x339e7fb2y1b714b018c04afef@mail.gmail.com","threadId":"23167","inReplyTo":"25yNvbuAivZlBuEJoRhXtfoEc7HEZorM5qOrwgQKk7FER_fdzljyMQ@cipher.nrlssc.navy.mil","subject":"Re: What's cooking in git.git (Mar 2010, #06; Wed, 24)","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-03-26T05:47:07Z","receivedAt":"2010-03-26T05:47:07Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Mar 25, 2010 at 5:27 PM, Brandon Casey\n<brandon.casey.ctr@nrlssc.navy.mil> wrote:\n> On 03/25/2010 10:11 AM, Nguyen Thai Ngoc Duy wrote:\n>> 2010/3/25 Junio C Hamano <gitster@pobox.com>:\n>>> * ar/config-from-command-line (2010-03-19) 1 commit\n>>>  - Allow passing of configuration parameters in the command line\n>>>\n>>> * bc/t5505-fix (2010-03-19) 3 commits\n>>>  - t/t5505-remote.sh: escape * to prevent interpretation by shell as glob\n>>>  - t5505: add missing &&\n>>>  - t5505: remove unnecessary subshell invocations\n>\n> methinks you were over-aggressive with your cut/paste?  I don't think bc/t5505-fix\n> contains a strndup.  Hopefully, it does not break your build on Solaris.\n\nYeah. It should have been after ar/config-from-command-line. Made me\nwonder why this topic had test fixes..\n-- \nDuy\n"},{"id":"137833","messageId":"1269592797-18487-1-git-send-email-icomfort@stanford.edu","threadId":"23167","inReplyTo":"1269569690-sup-4884@pinkfloyd.chass.utoronto.ca","subject":"[PATCH] RPM spec: include bash completion support","fromName":"Ian Ward Comfort","fromEmail":"icomfort@stanford.edu","sentAt":"2010-03-26T08:39:57Z","receivedAt":"2010-03-26T08:39:57Z","isPatch":true,"sender":{"key":"icomfort@stanford.edu","avatar":"https://avatars.githubusercontent.com/u/202841?v=4"},"body":"Include the bash completion routines from the contrib/ directory in our core\nRPM, in the de facto standard location.\n\nSigned-off-by: Ian Ward Comfort <icomfort@stanford.edu>\n---\n\nOn 25 Mar 2010, at 7:19 PM, Ben Walton wrote:\n> Excerpts from Junio C Hamano's message of Wed Mar 24 20:41:16 -0400 2010:\n> \n> > * bw/git-completion-rpmspec (2010-03-20) 1 commit\n> > - Add a git-completion rpm subpackage to the spec\n> > \n> > Shipping bash-completion as part of RPM package; since Todd Zullinger who\n> > packages git for Fedora joined the thread, I am hoping that I can defer\n> > the direction of the final version to the discussion between Todd and Ben.\n> \n> I think Todd made a good case for making this part of the core git rpm.\n> Ian's patch would be more suited for inclusion in this case. The remaining\n> question is whether to stick it in /etc/bash_completion.d or in\n> /usr/share/bash_completion.d (the triggers vs direct bit).\n\n/usr/share/bash-completion was the alternative, I believe.\n\n> The closer the core spec file is to the one that distro's use, the better.\n> This is a reciprocal benefit, I think.\n\nI agree.  After more diligent research (following Todd's tip about the new\nupstream), I gather that bash completion works as follows on all of Fedora,\nEPEL, Mandriva and Gentoo.  The bash-completion package itself:\n\n* Installs a (mostly-)empty /etc/bash_completion.d directory.\n\n* Installs numerous completion modules into /usr/share/bash-completion.\n\n* Defines %triggers for other packages, to symlink its own completion modules\n  for their binaries from /usr/share/bash-completion to /etc/bash_completion.d\n  when those packages are installed.\n\n* Induces interactive shells (via one mechanism or another) to source the\n  contents of /etc/bash_completion.d.\n\nDebian (FWIW) currently installs all completion modules directly into\n/etc/bash_completion.d.  A promising thread from January 2009 on the upstream\nmailing list seemed poised to unify all these distros' treatment, but stalled\nafter a dozen messages [1].\n\nUnfortunately, nothing in the above clarifies how other packages are expected\nto ship their own completion support.  Currently, however, the Git packages\n(and what other packages I've found with completions) in all these distros --\nwith the possible exception of Gentoo, which I haven't been able to verify --\ninstall completions directly into /etc/bash_completion.d.  This seems natural,\ngiven that the symlink mechanism's current function is to have completions for\nall and only installed packages in /etc/bash_completion.d.\n\nI also think Todd's argument is sound, and propose that we ship bash\ncompletions in the core package in /etc/bash_completion.d/git.  I don't see\nany reason to provide a \"--without completion\" option, since downstream\npackagers will continue to either patch or replace our spec if it doesn't meet\ntheir needs.\n\n[1] http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-January/000670.html\n\n-- \nIan Ward Comfort <icomfort@stanford.edu>\nSystems Team Lead, Academic Computing Services, Stanford University\n\n git.spec.in |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git.spec.in b/git.spec.in\nindex ee74a5e..9533147 100644\n--- a/git.spec.in\n+++ b/git.spec.in\n@@ -127,6 +127,9 @@ find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'\n rm -rf $RPM_BUILD_ROOT%{_mandir}\n %endif\n \n+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d\n+install -m 644 -T contrib/completion/git-completion.bash $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/git\n+\n %clean\n rm -rf $RPM_BUILD_ROOT\n \n@@ -136,6 +139,7 @@ rm -rf $RPM_BUILD_ROOT\n %doc README COPYING Documentation/*.txt\n %{!?_without_docs: %doc Documentation/*.html Documentation/howto}\n %{!?_without_docs: %doc Documentation/technical}\n+%{_sysconfdir}/bash_completion.d\n \n %files svn\n %defattr(-,root,root)\n@@ -192,6 +196,9 @@ rm -rf $RPM_BUILD_ROOT\n # No files for you!\n \n %changelog\n+* Fri Mar 26 2010 Ian Ward Comfort <icomfort@stanford.edu>\n+- Ship bash completion support from contrib/ in the core package.\n+\n * Sun Jan 31 2010 Junio C Hamano <gitster@pobox.com>\n - Do not use %define inside %{!?...} construct.\n \n-- \n1.7.0.2\n"},{"id":"137841","messageId":"1269605445-sup-6122@pinkfloyd.chass.utoronto.ca","threadId":"23167","inReplyTo":"1269592797-18487-1-git-send-email-icomfort@stanford.edu","subject":"Re: [PATCH] RPM spec: include bash completion support","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2010-03-26T12:10:51Z","receivedAt":"2010-03-26T12:10:51Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Ian Ward Comfort's message of Fri Mar 26 04:39:57 -0400 2010:\n> Include the bash completion routines from the contrib/ directory in our core\n> RPM, in the de facto standard location.\n> \n> Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>\n\nAcked-by: Ben Walton <bwalton@artsci.utoronto.ca>\n-- \nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"137844","messageId":"c23f5db54cc8e5a4a5ee10c6533ac9fb@212.159.54.234","threadId":"23167","inReplyTo":"1269592797-18487-1-git-send-email-icomfort@stanford.edu","subject":"Re: [PATCH] RPM spec: include bash completion support","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2010-03-26T13:07:45Z","receivedAt":"2010-03-26T13:07:45Z","isPatch":true,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Fri, 26 Mar 2010 01:39:57 -0700, Ian Ward Comfort\n<icomfort@stanford.edu> wrote:\n> Unfortunately, nothing in the above clarifies how other packages are\n> expected to ship their own completion support.  Currently, however,\n> the Git packages (and what other packages I've found with completions)\n> in all these distros -- with the possible exception of Gentoo, which\n> I haven't been able to verify -- install completions directly into\n> /etc/bash_completion.d.  This seems natural, given that the symlink\n> mechanism's current function is to have completions for all and only\n> installed packages in /etc/bash_completion.d.\n\nFWIW, Gentoo installs the completion script as\n/usr/share/bash-completion/git - since installing a package isn't supposed\nto enable completion but only to make it available.  Since Gentoo doesn't\nuse RPMs this isn't actually relevant though ;).\n\n-- \nJulian\n"},{"id":"137909","messageId":"20100326225356.GA6797@blimp.localdomain","threadId":"23167","inReplyTo":"81b0412b1003251611h62222eabw247ec59678c198ad@mail.gmail.com","subject":"[PATCH 1/2] Allow passing of configuration parameters in the command line","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-26T22:53:57Z","receivedAt":"2010-03-26T22:53:57Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"The values passed this way will override whatever is defined\nin the config files.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\nI replaced strndup with xstrndup, and calloc with xcalloc. A common workaround\nfor broken flexarray support has got a small hint, and that typo got fixed\ntoo. A test for CamelCase config key added.\n\nThis patch replaces the one I sent earlier.\n\nAlex Riesen, Fri, Mar 26, 2010 00:11:51 +0100:\n> On Thu, Mar 25, 2010 at 17:27, Brandon Casey\n> <brandon.casey.ctr@nrlssc.navy.mil> wrote:\n> > On 03/25/2010 10:11 AM, Nguyen Thai Ngoc Duy wrote:\n> >> 2010/3/25 Junio C Hamano <gitster@pobox.com>:\n> >>> * ar/config-from-command-line (2010-03-19) 1 commit\n> >>>  - Allow passing of configuration parameters in the command line\n> >> This breaks my build on Solaris because it uses strndup, which is not available.\n> >\n> > A quick glance at ar/config-from.. also detected an unchecked calloc().\n> >\n> > Alex, any reason xcalloc wasn't used?\n> \n> Just missed it. Long time away from Git sources.\n> \n\nDone.\n\n> > Would the code be simpler if strbufs were used?  Then you wouldn't need to duplicate\n> > the skip_space and trailing_space functionality provided in the strbuf library, and\n> > would just need a new function named strbuf_tolower.\n> \n> But this indeed makes sense. Promise to take a look at it after some sleep.\n\nDone, but... It does make the code more readable, but I don't like strbuf\nanymore. It has grown ugly. A lot of allocations, reallocations and copying\naround. It may be efficient, but I found it hard to convince myself that it\nis. And it should fragment heap a lot (doesn't matter much in this particular\ncase but it may be an issue somewhere. Not all heaps are as robust as glibc's\none).\n\nThis patch is separate, and I didn't strbuf_tolower thing: the only other place\nin whole project which lowcases a string is in mailmap, and doesn't look like\nit can profit from conversion to strbuf (just look for tolower in mailmap.c).\n\n> > Also, should config_parametes_tail be spelled config_parameters_tail?\n> \n\nDone\n\n Documentation/git.txt  |    7 +++++\n builtin/config.c       |    6 +++-\n cache.h                |    2 +\n config.c               |   71 ++++++++++++++++++++++++++++++++++++++++++++++++\n git.c                  |    9 ++++++\n t/t1300-repo-config.sh |    8 +++++\n 6 files changed, 102 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 4e00b31..0fc5cfe 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -12,6 +12,7 @@ SYNOPSIS\n 'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\n     [-p|--paginate|--no-pager] [--no-replace-objects]\n     [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n+    [-c name=value]\n     [--help] COMMAND [ARGS]\n \n DESCRIPTION\n@@ -220,6 +221,12 @@ displayed. See linkgit:git-help[1] for more information,\n because `git --help ...` is converted internally into `git\n help ...`.\n \n+-c <name>=<value>::\n+\tPass a configuration parameter to the command. The value\n+\tgiven will override values from configuration files.\n+\tThe <name> is expected in the same format as listed by\n+\t'git config' (subkeys separated by dots).\n+\n --exec-path::\n \tPath to wherever your core git programs are installed.\n \tThis can also be controlled by setting the GIT_EXEC_PATH\ndiff --git a/builtin/config.c b/builtin/config.c\nindex 4bc46b1..f3d1660 100644\n--- a/builtin/config.c\n+++ b/builtin/config.c\n@@ -197,7 +197,11 @@ static int get_value(const char *key_, const char *regex_)\n \t\tgit_config_from_file(show_config, system_wide, NULL);\n \tif (do_all && global)\n \t\tgit_config_from_file(show_config, global, NULL);\n-\tgit_config_from_file(show_config, local, NULL);\n+\tif (do_all)\n+\t\tgit_config_from_file(show_config, local, NULL);\n+\tgit_config_from_parameters(show_config, NULL);\n+\tif (!do_all && !seen)\n+\t\tgit_config_from_file(show_config, local, NULL);\n \tif (!do_all && !seen && global)\n \t\tgit_config_from_file(show_config, global, NULL);\n \tif (!do_all && !seen && system_wide)\ndiff --git a/cache.h b/cache.h\nindex 2928107..f5fa79e 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -936,6 +936,8 @@ extern int update_server_info(int);\n typedef int (*config_fn_t)(const char *, const char *, void *);\n extern int git_default_config(const char *, const char *, void *);\n extern int git_config_from_file(config_fn_t fn, const char *, void *);\n+extern int git_config_parse_parameter(const char *text);\n+extern int git_config_from_parameters();\n extern int git_config(config_fn_t fn, void *);\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 6963fbe..83ebe0c 100644\n--- a/config.c\n+++ b/config.c\n@@ -18,6 +18,62 @@ static int zlib_compression_seen;\n \n const char *config_exclusive_filename = NULL;\n \n+struct config_item\n+{\n+\tstruct config_item *next;\n+\tchar *value;\n+\tchar name[1 /* NUL */];\n+};\n+static struct config_item *config_parameters;\n+static struct config_item **config_parameters_tail = &config_parameters;\n+\n+static void lowercase(char *p)\n+{\n+\tfor (; *p; ++p)\n+\t\t*p = tolower(*p);\n+}\n+static char *skip_space(const char *p)\n+{\n+\tfor (; *p; ++p)\n+\t\tif (!isspace(*p))\n+\t\t\tbreak;\n+\treturn (char *)p;\n+}\n+static char *trailing_space(const char *begin, const char *p)\n+{\n+\twhile (p-- > begin)\n+\t\tif (!isspace(*p))\n+\t\t\tbreak;\n+\treturn (char *)p + 1;\n+}\n+\n+int git_config_parse_parameter(const char *text)\n+{\n+\tstruct config_item *ct;\n+\tconst char *name;\n+\tconst char *val;\n+\tname = skip_space(text);\n+\ttext = val = strchr(name, '=');\n+\tif (!text)\n+\t\ttext = name + strlen(name);\n+\ttext = trailing_space(name, text);\n+\tif (text <= name)\n+\t\treturn -1;\n+\tct = xcalloc(1, sizeof(struct config_item) + (text - name));\n+\tmemcpy(ct->name, name, text - name);\n+\tlowercase(ct->name);\n+\tif (!val)\n+\t\tct->value = NULL;\n+\telse {\n+\t\tval = skip_space(++val /* skip \"=\" */);\n+\t\ttext = trailing_space(val, val + strlen(val));\n+\t\tct->value = xstrndup(val, text - val);\n+\t}\n+\t*config_parameters_tail = ct;\n+\tconfig_parameters_tail = &ct->next;\n+\treturn 0;\n+}\n+\n static int get_next_char(void)\n {\n \tint c;\n@@ -699,6 +755,15 @@ int git_config_global(void)\n \treturn !git_env_bool(\"GIT_CONFIG_NOGLOBAL\", 0);\n }\n \n+int git_config_from_parameters(config_fn_t fn, void *data)\n+{\n+\tconst struct config_item *ct;\n+\tfor (ct = config_parameters; ct; ct = ct->next)\n+\t\tif (fn(ct->name, ct->value, data) < 0)\n+\t\t\treturn -1;\n+\treturn 0;\n+}\n+\n int git_config(config_fn_t fn, void *data)\n {\n \tint ret = 0, found = 0;\n@@ -730,6 +795,12 @@ int git_config(config_fn_t fn, void *data)\n \t\tfound += 1;\n \t}\n \tfree(repo_config);\n+\n+\tif (config_parameters) {\n+\t\tret += git_config_from_parameters(fn, data);\n+\t\tfound += 1;\n+\t}\n+\n \tif (found == 0)\n \t\treturn -1;\n \treturn ret;\ndiff --git a/git.c b/git.c\nindex 6bae305..99f0363 100644\n--- a/git.c\n+++ b/git.c\n@@ -8,6 +8,7 @@ const char git_usage_string[] =\n \t\"git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]\\n\"\n \t\"           [-p|--paginate|--no-pager] [--no-replace-objects]\\n\"\n \t\"           [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\\n\"\n+\t\"           [-c name=value\\n\"\n \t\"           [--help] COMMAND [ARGS]\";\n \n const char git_more_info_string[] =\n@@ -130,6 +131,14 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)\n \t\t\tsetenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0);\n \t\t\tif (envchanged)\n \t\t\t\t*envchanged = 1;\n+\t\t} else if (!strcmp(cmd, \"-c\")) {\n+\t\t\tif (*argc < 2) {\n+\t\t\t\tfprintf(stderr, \"-c expects a configuration string\\n\" );\n+\t\t\t\tusage(git_usage_string);\n+\t\t\t}\n+\t\t\tgit_config_parse_parameter((*argv)[1]);\n+\t\t\t(*argv)++;\n+\t\t\t(*argc)--;\n \t\t} else {\n \t\t\tfprintf(stderr, \"Unknown option: %s\\n\", cmd);\n \t\t\tusage(git_usage_string);\ndiff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh\nindex f11f98c..64f0508 100755\n--- a/t/t1300-repo-config.sh\n+++ b/t/t1300-repo-config.sh\n@@ -824,4 +824,12 @@ test_expect_success 'check split_cmdline return' \"\n \ttest_must_fail git merge master\n \t\"\n \n+test_expect_success 'git -c \"key=value\" support' '\n+\ttest \"z$(git -c name=value config name)\" = zvalue &&\n+\ttest \"z$(git -c core.name=value config core.name)\" = zvalue &&\n+\ttest \"z$(git -c CamelCase=value config camelcase)\" = zvalue &&\n+\ttest \"z$(git -c flag config --bool flag)\" = ztrue &&\n+\ttest_must_fail git -c core.name=value config name\n+'\n+\n test_done\n-- \n1.7.0.3.309.g532f0\n"},{"id":"137910","messageId":"20100326225601.GA9177@blimp.localdomain","threadId":"23167","inReplyTo":"20100326225356.GA6797@blimp.localdomain","subject":"[PATCH 2/2] Use strbufs instead of open-coded string manipulation","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-26T22:56:01Z","receivedAt":"2010-03-26T22:56:01Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Signed-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n\n config.c |   51 +++++++++++++++++++--------------------------------\n 1 files changed, 19 insertions(+), 32 deletions(-)\n\ndiff --git a/config.c b/config.c\nindex 83ebe0c..7a514fa 100644\n--- a/config.c\n+++ b/config.c\n@@ -7,6 +7,7 @@\n  */\n #include \"cache.h\"\n #include \"exec_cmd.h\"\n+#include \"strbuf.h\"\n \n #define MAXNAME (256)\n \n@@ -21,8 +22,8 @@ const char *config_exclusive_filename = NULL;\n struct config_item\n {\n \tstruct config_item *next;\n+\tchar *name;\n \tchar *value;\n-\tchar name[1 /* NUL */];\n };\n static struct config_item *config_parameters;\n static struct config_item **config_parameters_tail = &config_parameters;\n@@ -32,43 +33,29 @@ static void lowercase(char *p)\n \tfor (; *p; ++p)\n \t\t*p = tolower(*p);\n }\n-static char *skip_space(const char *p)\n-{\n-\tfor (; *p; ++p)\n-\t\tif (!isspace(*p))\n-\t\t\tbreak;\n-\treturn (char *)p;\n-}\n-static char *trailing_space(const char *begin, const char *p)\n-{\n-\twhile (p-- > begin)\n-\t\tif (!isspace(*p))\n-\t\t\tbreak;\n-\treturn (char *)p + 1;\n-}\n \n int git_config_parse_parameter(const char *text)\n {\n \tstruct config_item *ct;\n-\tconst char *name;\n-\tconst char *val;\n-\tname = skip_space(text);\n-\ttext = val = strchr(name, '=');\n-\tif (!text)\n-\t\ttext = name + strlen(name);\n-\ttext = trailing_space(name, text);\n-\tif (text <= name)\n+\tstruct strbuf tmp = STRBUF_INIT;\n+\tstruct strbuf **pair;\n+\tstrbuf_addstr(&tmp, text);\n+\tpair = strbuf_split(&tmp, '=');\n+\tif (pair[0]->len && pair[0]->buf[pair[0]->len - 1] == '=')\n+\t\tstrbuf_setlen(pair[0], pair[0]->len - 1);\n+\tstrbuf_trim(pair[0]);\n+\tif (!pair[0]->len) {\n+\t\tstrbuf_list_free(pair);\n \t\treturn -1;\n-\tct = xcalloc(1, sizeof(struct config_item) + (text - name));\n-\tmemcpy(ct->name, name, text - name);\n-\tlowercase(ct->name);\n-\tif (!val)\n-\t\tct->value = NULL;\n-\telse {\n-\t\tval = skip_space(++val /* skip \"=\" */);\n-\t\ttext = trailing_space(val, val + strlen(val));\n-\t\tct->value = xstrndup(val, text - val);\n \t}\n+\tct = xcalloc(1, sizeof(struct config_item));\n+\tct->name = strbuf_detach(pair[0], NULL);\n+\tif (pair[1]) {\n+\t\tstrbuf_trim(pair[1]);\n+\t\tct->value = strbuf_detach(pair[1], NULL);\n+\t}\n+\tstrbuf_list_free(pair);\n+\tlowercase(ct->name);\n \t*config_parameters_tail = ct;\n \tconfig_parameters_tail = &ct->next;\n \treturn 0;\n-- \n1.7.0.3.309.g532f0\n"},{"id":"138120","messageId":"7v7hov56ww.fsf@alter.siamese.dyndns.org","threadId":"23167","inReplyTo":"1269605445-sup-6122@pinkfloyd.chass.utoronto.ca","subject":"Re: [PATCH] RPM spec: include bash completion support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-29T18:17:35Z","receivedAt":"2010-03-29T18:17:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> Excerpts from Ian Ward Comfort's message of Fri Mar 26 04:39:57 -0400 2010:\n>> Include the bash completion routines from the contrib/ directory in our core\n>> RPM, in the de facto standard location.\n>> \n>> Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>\n>\n> Acked-by: Ben Walton <bwalton@artsci.utoronto.ca>\n\nThanks all; I'll queue this and expect any further tweaks to happen\nin-tree if necessary before the current 1.7.1 cycle goes to feature freeze\nin a few days.\n"}]}