{"thread":{"id":"22899","subject":"What's cooking in git.git (Mar 2010, #01; Wed, 03)","startedAt":"2010-03-04T00:02:20Z","lastAt":"2010-03-10T03:53:57Z","messageCount":38,"participants":["Junio C Hamano","Adam Simpkins","Björn Gustavsson","Tay Ray Chuan","Thomas Rast","Mark Lodato","Jonathan Nieder","Christian Couder","Miklos Vajna","Stephen Boyd","Erik Faye-Lund","Johannes Schindelin","Steven Drake"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136116","messageId":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":null,"subject":"What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-04T00:02:20Z","receivedAt":"2010-03-04T00:02:20Z","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' 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\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* dp/read-not-mmap-small-loose-object (2010-02-21) 1 commit\n  (merged to 'next' on 2010-02-21 at fa39a9a)\n + hash-object: don't use mmap() for small files\n\n* np/compress-loose-object-memsave (2010-02-21) 2 commits\n  (merged to 'next' on 2010-02-21 at 1e558d6)\n + sha1_file: be paranoid when creating loose objects\n + sha1_file: don't malloc the whole compressed result when writing out objects\n\n* ml/connect-refactor (2010-02-17) 1 commit\n  (merged to 'next' on 2010-02-21 at 7361651)\n + connect.c: move duplicated code to a new function 'get_host_and_port'\n\n* ml/encode-header-refactor (2010-02-23) 2 commits\n  (merged to 'next' on 2010-02-23 at ac4ec8f)\n + move encode_in_pack_object_header() to a better place\n  (merged to 'next' on 2010-02-21 at efe648b)\n + refactor duplicated encode_header in pack-objects and fast-import\n\n* ml/fill-mm-refactor (2010-02-16) 1 commit\n  (merged to 'next' on 2010-02-21 at 2fc5570)\n + refactor duplicated fill_mm() in checkout and merge-recursive\n\n* ml/send-pack-transport-refactor (2010-02-16) 1 commit\n  (merged to 'next' on 2010-02-21 at db276f4)\n + refactor duplicated code in builtin-send-pack.c and transport.c\n\n* rs/optim-text-wrap (2010-02-19) 4 commits\n  (merged to 'next' on 2010-02-21 at 70ef189)\n + utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()\n + utf8.c: remove strbuf_write()\n + utf8.c: remove print_spaces()\n + utf8.c: remove print_wrapped_text()\n\n* tr/maint-cherry-pick-list (2010-02-20) 1 commit\n  (merged to 'next' on 2010-02-21 at 65fded0)\n + cherry_pick_list: quit early if one side is empty\n\n* ld/maint-diff-quiet-w (2010-02-21) 2 commits\n  (merged to 'next' on 2010-02-21 at 4701142)\n + git-diff: add a test for git diff --quiet -w\n + git diff --quiet -w: check and report the status\n\n* jc/for-each-ref (2010-02-13) 4 commits\n  (merged to 'next' on 2010-02-21 at c9a6c2f)\n + for-each-ref --format='%(flag)'\n + for-each-ref --format='%(symref) %(symref:short)'\n + builtin-for-each-ref.c: check if we need to peel onion while parsing the format\n + builtin-for-each-ref.c: comment fixes\n\n* jn/gitweb-config-error-die (2010-02-14) 1 commit\n  (merged to 'next' on 2010-02-21 at e3ecd65)\n + gitweb: Die if there are parsing errors in config file\n\n* jn/maint-fix-pager (2010-02-22) 8 commits\n  (merged to 'next' on 2010-02-23 at 575e0e4)\n + tests: Fix race condition in t7006-pager\n  (merged to 'next' on 2010-02-21 at 640e10c)\n + t7006-pager: if stdout is not a terminal, make a new one\n + tests: Add tests for automatic use of pager\n + am: Fix launching of pager\n + git svn: Fix launching of pager\n + git.1: Clarify the behavior of the --paginate option\n + Make 'git var GIT_PAGER' always print the configured pager\n + Fix 'git var' usage synopsis\n\n* ml/color-when (2010-02-16) 1 commit\n  (merged to 'next' on 2010-02-21 at d52c051)\n + Add an optional argument for --color options\n\n* hm/imap-send-cram-md5 (2010-02-15) 1 commit\n  (merged to 'next' on 2010-02-21 at de8f650)\n + imap-send: support CRAM-MD5 authentication\n\n* gf/maint-sh-setup-nongit-ok (2010-02-16) 1 commit\n  (merged to 'next' on 2010-02-21 at aca55e6)\n + require_work_tree broken with NONGIT_OK\n\n* jc/maint-status-preload (2010-02-17) 1 commit\n  (merged to 'next' on 2010-02-21 at d79e163)\n + status: preload index to optimize lstat(2) calls\n\n* ac/cvsimport-revision-mapping (2010-02-06) 1 commit\n  (merged to 'next' on 2010-02-17 at 6756446)\n + cvsimport: new -R option: generate .git/cvs-revisions mapping\n\n* jn/maint-makedepend (2010-01-26) 5 commits\n  (merged to 'next' on 2010-02-21 at 34a3e48)\n + Makefile: drop dependency on $(wildcard */*.h)\n + Makefile: clean up http-walker.o dependency rules\n + Makefile: remove wt-status.h from LIB_H\n + Makefile: make sure test helpers are rebuilt when headers change\n + Makefile: add missing header file dependencies\n (this branch is used by jn/makedepend and jn/master-makedepend.)\n\n* jn/master-makedepend (2010-01-26) 0 commits\n (this branch uses jn/maint-makedepend; is used by jn/makedepend.)\n\n* jn/makedepend (2010-02-28) 10 commits\n  (merged to 'next' on 2010-02-28 at 6604fd0)\n + Makefile: clarify definition of TEST_OBJS\n  (merged to 'next' on 2010-02-21 at 34a3e48)\n + Makefile: always remove .depend directories on 'make clean'\n + Makefile: tuck away generated makefile fragments in .depend\n + Teach Makefile to check header dependencies\n + Makefile: list standalone program object files in PROGRAM_OBJS\n + Makefile: lazily compute header dependencies\n + Makefile: list generated object files in OBJECTS\n + Makefile: disable default implicit rules\n + Makefile: rearrange dependency rules\n + Makefile: transport.o depends on branch.h now\n (this branch uses jn/maint-makedepend and jn/master-makedepend.)\n\n* jc/grep-author-all-match-implicit (2010-01-17) 1 commit\n  (merged to 'next' on 2010-02-17 at 3b7be80)\n + \"log --author=me --grep=it\" should find intersection, not union\n\n* jh/maint-submodule-status-in-void (2010-03-03) 1 commit\n + submodule summary: Don't barf when invoked in an empty repo\n\nWe might also want to enable showing the submodule change, which is\ncurrently queued in 'pu'.\n\n--------------------------------------------------\n[New Topics]\n\n* bg/apply-fix-blank-at-eof (2010-02-27) 5 commits\n - t3417: Add test cases for \"rebase --whitespace=fix\"\n - t4124: Add additional tests of --whitespace=fix\n - apply: Allow blank context lines to match beyond EOF\n - apply: Remove the quick rejection test\n - apply: Don't unnecessarily update line lengths in the preimage\n\nProbably ready for 'next'.\n\n* gb/maint-submodule-env (2010-02-25) 5 commits\n  (merged to 'next' on 2010-02-25 at 8c22d03)\n + is_submodule_modified(): clear environment properly\n + submodules: ensure clean environment when operating in a submodule\n + shell setup: clear_local_git_env() function\n + rev-parse: --local-env-vars option\n + Refactor list of of repo-local env vars\n\nReady for 'master'.\n\n* jc/fetch-param (2010-02-24) 3 commits\n  (merged to 'next' on 2010-02-25 at e95e252)\n + fetch --all/--multiple: keep all the fetched branch information\n + builtin-fetch --all/--multi: propagate options correctly\n + t5521: fix and modernize\n\nReady for 'master'.\n\n* jk/maint-push-tracking-wo-remote (2010-02-24) 1 commit\n  (merged to 'next' on 2010-02-25 at da946ba)\n + push: fix segfault for odd config\n\nReady for 'master'.\n\n* mb/shortlog-nongit-stdin (2010-02-24) 1 commit\n  (merged to 'next' on 2010-02-25 at d17bb74)\n + shortlog: warn the user when there is no input\n\nReady for 'master'.\n\n* sg/bash-completion (2010-02-23) 4 commits\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* fn/maint-mkdtemp-compat (2010-02-25) 1 commit\n  (merged to 'next' on 2010-02-25 at 2899a47)\n + Fix gitmkdtemp: correct test for mktemp() return value\n\nReady for 'master'.\n\n* ml/maint-grep-doc (2010-02-25) 4 commits\n  (merged to 'next' on 2010-03-02 at a75dfe0)\n + grep docs: document --no-index option\n  (merged to 'next' on 2010-02-25 at ec1faf8)\n + grep docs: --cached and <tree>... are incompatible\n + grep docs: use AsciiDoc literals consistently\n + grep docs: pluralize \"Example\" section\n\nReady for 'master'.\n\n* fl/askpass (2010-03-03) 2 commits\n - git-core: Support retrieving passwords with GIT_ASKPASS\n - git-svn: Support retrieving passwords with GIT_ASKPASS\n\nAs we export GIT_ASKPASS when it is not set but SSH_ASKPASS is from \"git\"\npotty (the third patch in the series, which I applied to 'master'), I\nremoved the first hunk that did that by hand.\n\n* as/maint-expire (2010-02-26) 2 commits\n  (merged to 'next' on 2010-03-02 at 4015ae4)\n + reflog: honor gc.reflogexpire=never\n + prune: honor --expire=never\n\n* jc/color-attrs (2010-02-27) 1 commit\n - color: allow multiple attributes\n\nPerhaps I should remove the counting, extend COLOR_MAXLEN and remove the\ntest that checks overlong color specification and then merge this to\n'next'.\n\n* jc/maint-add-ignored-dir (2010-02-28) 3 commits\n - builtin-add: fix exclude handling\n - tests for \"git add ignored-dir/file\" without -f\n - t0050: mark non-working test as such\n\nNot quite happy.\n\n* ml/color-grep (2010-02-26) 3 commits\n - grep: Colorize selected, context, and function lines\n - grep: Colorize filename, line number, and separator\n - Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_*\n\nThere was a comment about not special casing filename coloring?\n\n* sb/notes-parse-opt (2010-02-27) 1 commit\n - notes: rework subcommands and parse options\n (this branch uses early parts of jh/notes and tr/notes-display.)\n\n* sh/am-keep-cr (2010-02-27) 4 commits\n  (merged to 'next' on 2010-03-02 at ffe3c5e)\n + git-am: Add tests for `--keep-cr`, `--no-keep-cr` and `am.keepcr`\n + git-am: Add am.keepcr and --no-keep-cr to override it\n + git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit\n + documentation: 'git-mailsplit --keep-cr' is not hidden anymore\n\n* bw/union-merge-refactor (2010-03-01) 4 commits\n - merge-file: add option to select union merge favor\n - merge-file: add option to specify the marker size\n - refactor merge flags into xmparam_t\n - make union merge an xdl merge favor\n\nThe first two are ready for 'next'; the latter two are safe and perhaps\nuseful.\n\n* mg/test-svn-info (2010-03-03) 2 commits\n - t9119-git-svn-info.sh: test with svn 1.6.* as well\n - git-svn: req_svn when needed\n\n--------------------------------------------------\n[Stalled]\n\n* sd/format-patch-to (2010-02-17) 1 commit\n - Add 'git format-patch --to=' option and 'format.to' configuration variable.\n\nShouldn't be too hard to add tests to t4014; other than that looked ready\nfor 'next'.\n\n* sd/log-decorate (2010-02-17) 3 commits\n - log.decorate: usability fixes\n - Add `log.decorate' configuration variable.\n - git_config_maybe_bool()\n\nProbably ready for 'next', except that people need to be warned about\nhaving to update their scripts to explicitly pass --no-decorate to keep\nthem working.  A good idea to disable this when --pretty was given, just\nlike notes are disabled by default, was floated.\n\n* pb/log-first-parent-p-m (2010-02-10) 1 commit\n  (merged to 'next' on 2010-02-17 at 2f8e5ae)\n + git log -p -m: document -m and honor --first-parent\n\nNeeds tests but otherwise looked fine.  We might want to teach \"-m trumps\nimplicit --cc\" to \"git show\", but that is a totally separate topic.\n\nI actually care about this \"log -p --first-parent\" very much, but if Pasky\nis counting on that and procrastinating until I write the tests myself, he\nis in for a disappointment.  I don't have that much free time these days.\nHelp is appreciated.\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--------------------------------------------------\n[Cooking]\n\n* ld/push-porcelain (2010-02-26) 4 commits\n  (merged to 'next' on 2010-03-02 at d15bb1e)\n + git-push: add tests for git push --porcelain\n + git-push: make git push --porcelain print \"Done\"\n + git-push: send \"To <remoteurl>\" messages to the standard output in --porcelain mode\n + git-push: fix an advice message so it goes to stderr\n\n* sd/init-template (2010-03-02) 5 commits\n  (merged to 'next' on 2010-03-02 at 2d87e3f)\n + wrap-for-bin: do not export an empty GIT_TEMPLATE_DIR\n + t/t0001-init.sh: add test for 'init with init.templatedir set'\n + init: having keywords without value is not a global error.\n + Add a \"TEMPLATE DIRECTORY\" section to git-init[1].\n + Add `init.templatedir` configuration variable.\n\n* il/loosen-remote-helper-names (2010-02-23) 1 commit\n  (merged to 'next' on 2010-02-25 at 5c22a39)\n + Allow '+', '-' and '.' in remote helper names\n\nReady for 'master'.\n\n* jk/maint-add--interactive-delete (2010-02-22) 1 commit\n  (merged to 'next' on 2010-02-24 at 908cef8)\n + add-interactive: fix bogus diff header line ordering\n\nProbably ready for 'master'.\n\n* js/runtime-prefix-trace-not-warn (2010-02-23) 1 commit\n  (merged to 'next' on 2010-02-24 at 8d9d305)\n + Print RUNTIME_PREFIX warning only when GIT_TRACE is set\n\nReady for 'master'.\n\n* lt/deepen-builtin-source (2010-02-22) 1 commit\n  (merged to 'next' on 2010-02-25 at 320aa74)\n + Move 'builtin-*' into a 'builtin/' subdirectory\n\nThis is a painful one to keep out of 'master' for a long time, as any\ntopic with new builtin commands will need evil merges to adjust to it.\n\n* tc/http-cleanup (2010-03-02) 7 commits\n - remote-curl: init walker only when needed\n - remote-curl: use http_fetch_ref() instead of walker wrapper\n - http: init and cleanup separately from http-walker\n - http-walker: cleanup more thoroughly\n - http-push: remove \"|| 1\" to enable verbose check\n - t554[01]-http-push: refactor, add non-ff tests\n - t5541-http-push: check that ref is unchanged for non-ff test\n\nRerolled.\n\n* tr/notes-display (2010-02-23) 11 commits\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 uses early parts of jh/notes; is used by sb/notes-parse-opt.)\n\nDidn't look too carefully except for the second one.\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 in progress.\n\n* jc/maint-fix-mailinfo-strip (2010-02-19) 1 commit\n  (merged to 'next' on 2010-02-24 at 621fa3d)\n + mailinfo: do not strip leading spaces even for a header line\n\nReady for 'master'.\n\n* ne/pack-local-doc (2010-02-24) 3 commits\n  (merged to 'next' on 2010-02-25 at 75cfba5)\n + pack-objects documentation: Fix --honor-pack-keep as well.\n + pack-objects documentation: reword \"objects that appear in the standard input\"\n + Documentation: pack-objects: Clarify --local's semantics.\n\nReady for 'master'.\n\n* mm/mkstemps-mode-for-packfiles (2010-02-22) 6 commits\n  (merged to 'next' on 2010-02-24 at 31b5903)\n + Use git_mkstemp_mode instead of plain mkstemp to create object files\n + git_mkstemps_mode: don't set errno to EINVAL on exit.\n + Use git_mkstemp_mode and xmkstemp_mode in odb_mkstemp, not chmod later.\n + git_mkstemp_mode, xmkstemp_mode: variants of gitmkstemps with mode argument.\n + Move gitmkstemps to path.c\n + Add a testcase for ACL with restrictive umask.\n\nReady for 'master'.\n\n* tc/transport-verbosity (2010-02-24) 10 commits\n - transport: update flags to be in running order\n - fetch and pull: learn --progress\n - push: learn --progress\n - transport->progress: use flag authoritatively\n - clone: support multiple levels of verbosity\n - push: support multiple levels of verbosity\n - fetch: refactor verbosity option handling into transport.[ch]\n - Documentation/git-push: put --quiet before --verbose\n - Documentation/git-pull: put verbosity options before merge/fetch ones\n - Documentation/git-clone: mention progress in -v\n\nDidn't look very carefully.  Comments from transport people are very much\nappreciated before moving this forward.\n\n* cp/add-u-pathspec (2010-02-09) 2 commits\n  (merged to 'next' on 2010-02-24 at 2f3f2bc)\n + test for add with non-existent pathspec\n + git add -u: die on unmatched pathspec\n\nNot quite happy, but will merge to 'master' shortly anyway.\n\n* nd/root-git (2010-02-14) 5 commits\n  (merged to 'next' on 2010-02-25 at bff4955)\n + Add test for using Git at root of file system\n + Support working directory located at root\n + Move offset_1st_component() to path.c\n + init-db, rev-parse --git-dir: do not append redundant slash\n + make_absolute_path(): Do not append redundant slash\n\nProbably ready for 'master'.\n\n* jh/notes (2010-02-24) 32 commits\n  (merged to 'next' on 2010-02-24 at c88263d)\n + notes: fix malformed tree entry\n + builtin-notes: Minor (mostly parse_options-related) fixes\n  (merged to 'next' on 2010-02-21 at 75fc451)\n + builtin-notes: Add \"copy\" subcommand for copying notes between objects\n + builtin-notes: Misc. refactoring of argc and exit value handling\n + builtin-notes: Add -c/-C options for reusing notes\n + builtin-notes: Refactor handling of -F option to allow combining -m and -F\n + builtin-notes: Deprecate the -m/-F options for \"git notes edit\"\n + builtin-notes: Add \"append\" subcommand for appending to note objects\n + builtin-notes: Add \"add\" subcommand for adding notes to objects\n + builtin-notes: Add --message/--file aliases for -m/-F options\n + builtin-notes: Add \"list\" subcommand for listing note objects\n + Documentation: Generalize git-notes docs to 'objects' instead of 'commits'\n + builtin-notes: Add \"prune\" subcommand for removing notes for missing objects\n + Notes API: prune_notes(): Prune notes that belong to non-existing objects\n + t3305: Verify that removing notes triggers automatic fanout consolidation\n + builtin-notes: Add \"remove\" subcommand for removing existing notes\n + Teach builtin-notes to remove empty notes\n + Teach notes code to properly preserve non-notes in the notes tree\n + t3305: Verify that adding many notes with git-notes triggers increased fanout\n + t3301: Verify successful annotation of non-commits\n + Builtin-ify git-notes\n + Refactor notes concatenation into a flexible interface for combining notes\n + Notes API: Allow multiple concurrent notes trees with new struct notes_tree\n + Notes API: write_notes_tree(): Store the notes tree in the database\n + Notes API: for_each_note(): Traverse the entire notes tree with a callback\n + Notes API: get_note(): Return the note annotating the given object\n + Notes API: remove_note(): Remove note objects from the notes tree structure\n + Notes API: add_note(): Add note objects to the internal notes tree structure\n + Notes API: init_notes(): Initialize the notes tree from the given notes ref\n + Add tests for checking correct handling of $GIT_NOTES_REF and core.notesRef\n + Notes API: get_commit_notes() -> format_note() + remove the commit restriction\n + Minor cosmetic fixes to notes.c\n (this branch shares commits with sb/notes-parse-opt and tr/notes-display.)\n\nReady for 'master'.\n\n* cc/reset-keep (2010-01-19) 5 commits\n - reset: disallow using --keep when there are unmerged entries\n - reset: disallow \"reset --keep\" outside a work tree\n - Documentation: reset: describe new \"--keep\" option\n - reset: add test cases for \"--keep\" option\n - reset: add option \"--keep\" to \"git reset\"\n\nI am not sure if this series is useful, and even less sure if the\nusefulness of it outweighs the confusion factor.\n"},{"id":"136117","messageId":"20100304003615.GN28452@facebook.com","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Adam Simpkins","fromEmail":"simpkins@facebook.com","sentAt":"2010-03-04T00:36:15Z","receivedAt":"2010-03-04T00:36:15Z","isPatch":false,"sender":{"key":"simpkins@facebook.com","avatar":null},"body":"On Wed, Mar 03, 2010 at 04:02:20PM -0800, Junio C Hamano wrote:\n> \n> * as/maint-expire (2010-02-26) 2 commits\n>   (merged to 'next' on 2010-03-02 at 4015ae4)\n>  + reflog: honor gc.reflogexpire=never\n>  + prune: honor --expire=never\n\nI take it you didn't like the refactoring of the parsing code?  I\nagree that it is a decent sized change for relatively little added\nvalue, although it does seem nice to make the option handling\nconsistent.  I was also unsure if the expiration-date handling was\ncommon enough that it was worth putting in date.c and config.c, but I\ndidn't really see a better place.\n\nFeel free to let me know if you had any specific complaints about it,\nor if you think it could be done in another way that so that it would\nbe worth including.\n\n-- \nAdam Simpkins\nsimpkins@facebook.com\n"},{"id":"136140","messageId":"6672d0161003040026u6d1f7a69h20566924b9ade43@mail.gmail.com","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2010-03-04T08:26:56Z","receivedAt":"2010-03-04T08:26:56Z","isPatch":false,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"On Thu, Mar 4, 2010 at 1:02 AM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> * bg/apply-fix-blank-at-eof (2010-02-27) 5 commits\n>  - t3417: Add test cases for \"rebase --whitespace=fix\"\n>  - t4124: Add additional tests of --whitespace=fix\n>  - apply: Allow blank context lines to match beyond EOF\n>  - apply: Remove the quick rejection test\n>  - apply: Don't unnecessarily update line lengths in the preimage\n>\n> Probably ready for 'next'.\n\nI have realized that there is one remaining minor issue.\n\nIf both --whitespace=fix and --ignore-space-change are given,\nnew blank lines ending in LF may be added to the end of the file.\nThat is the expected behavior if the rest of the file has\nLF line endings, but not if the rest of the file has CR-LF\nline endings.\n\nI think I have figured out how to fix it and I will send\na patch as soon as I have actually implemented it.\n\n-- \nBjörn Gustavsson, Erlang/OTP, Ericsson AB\n"},{"id":"136147","messageId":"be6fef0d1003040409o5a1e3396l8249951e8d65b1ee@mail.gmail.com","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-03-04T12:09:16Z","receivedAt":"2010-03-04T12:09:16Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Thu, Mar 4, 2010 at 8:02 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> * tc/transport-verbosity (2010-02-24) 10 commits\n>  - transport: update flags to be in running order\n>  - fetch and pull: learn --progress\n>  - push: learn --progress\n>  - transport->progress: use flag authoritatively\n>  - clone: support multiple levels of verbosity\n>  - push: support multiple levels of verbosity\n>  - fetch: refactor verbosity option handling into transport.[ch]\n>  - Documentation/git-push: put --quiet before --verbose\n>  - Documentation/git-pull: put verbosity options before merge/fetch ones\n>  - Documentation/git-clone: mention progress in -v\n>\n> Didn't look very carefully.  Comments from transport people are very much\n> appreciated before moving this forward.\n\nthe last discussion on this topic centred around the git-pull\ndocumentation, which this latest iteration has addressed. Jeff also\ngave his OK for the previous iteration.\n\nI also noticed a merge conflict - I think the resolution looked ok.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"136163","messageId":"7v635c6izh.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"6672d0161003040026u6d1f7a69h20566924b9ade43@mail.gmail.com","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-04T18:26:42Z","receivedAt":"2010-03-04T18:26:42Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Björn Gustavsson <bgustavsson@gmail.com> writes:\n\n> If both --whitespace=fix and --ignore-space-change are given,\n> new blank lines ending in LF may be added to the end of the file.\n> That is the expected behavior if the rest of the file has\n> LF line endings, but not if the rest of the file has CR-LF\n> line endings.\n>\n> I think I have figured out how to fix it and I will send\n> a patch as soon as I have actually implemented it.\n\nThanks.\n"},{"id":"136164","messageId":"7vy6i854es.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"be6fef0d1003040409o5a1e3396l8249951e8d65b1ee@mail.gmail.com","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-04T18:26:51Z","receivedAt":"2010-03-04T18:26:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> On Thu, Mar 4, 2010 at 8:02 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> * tc/transport-verbosity (2010-02-24) 10 commits\n> ...\n> the last discussion on this topic centred around the git-pull\n> documentation, which this latest iteration has addressed. Jeff also\n> gave his OK for the previous iteration.\n>\n> I also noticed a merge conflict - I think the resolution looked ok.\n\nThanks.\n"},{"id":"136169","messageId":"7vmxynydac.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-04T21:42:19Z","receivedAt":"2010-03-04T21:42:19Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> * cc/reset-keep (2010-01-19) 5 commits\n>  - reset: disallow using --keep when there are unmerged entries\n>  - reset: disallow \"reset --keep\" outside a work tree\n>  - Documentation: reset: describe new \"--keep\" option\n>  - reset: add test cases for \"--keep\" option\n>  - reset: add option \"--keep\" to \"git reset\"\n>\n> I am not sure if this series is useful, and even less sure if the\n> usefulness of it outweighs the confusion factor.\n\nRegarding this, I've been thinking about how I would explain this new\nfeature to end users (both new ones and old timers) as a good addition.  I\nstill haven't reached a satisfactory explanation, but here is my \"WIP\" try\nto describe a scenario.\n\nI understand that in essense, \"reset --keep\" does exactly a \"checkout\n<commit>\" does but without detaching the HEAD.  I often deliberately stay\non detached HEAD because I find it highly useful that I can jump around\nfreely with \"checkout <commit>\" once the head is detached (I would stay in\na detached HEAD state and keep local changes around).  I think there must\nbe a similar usefulness I can gain by \"reset --keep\".\n\nBut I am not really succeeding to explain that to potential users.\n\n    I have built commits A, B and C on my 'topic' branch, and the contents\n    in the working tree is a checkout of C (which is at the tip of the\n    branch).  I can make a small improvement, and start hacking.  And then\n    I realize that the change I just did, which I haven't committed nor\n    even added, is an improvement to commit A.\n\n    I could do:\n\n        $ git checkout topic~2              ;# to detach at A\n        $ git commit --amend -a             ;# to improve on A\n        $ git rebase --onto HEAD @{1} topic ;# rebase the rest and come back\n\n    to fix up A and rebuild B and C on top of it.  With \"reset --keep\",\n    I could do this instead:\n\n        $ last=$(git rev-parse HEAD)\n        $ git reset --keep topic~2\n        $ git commit --amend -a\n        $ git rebase --onto HEAD @{1} @{2}  ;# rebase the reset\n        $ git branch -f topic               ;# and come\n        $ git checkout topic                ;# back\n\nThe above however is clearly not an improvement.\n\nSo far, the _only_ use case I can think of that \"reset --keep\" may be\nsuperiour than anything existing is this:\n\n    I have built commits A, B and C on my 'topic' branch, and the contents\n    in the working tree is a checkout of C (which is at the tip of the\n    branch).  I can make a small improvement, and start hacking.  And then\n    I realize that the change I just did, which I haven't committed nor\n    even added, is an improvement to commit A.  Also I realize that B and\n    C are completely bogus, and I want to get rid of them.\n\n    I could do:\n\n        $ git checkout topic~2\t\t;# to detach at A\n        $ git commit --amend -a         ;# fix it\n        $ git branch -f topic           ;# the rest I do not need\n        $ git checkout topic\t        ;# and now on the branch\n\n    but it would be far easier if I can do this:\n\n        $ git reset --keep topic~2\n        $ git commit --amend -a\n\nYou have some addition in Documentation/git-reset.txt in this topic, and\nthe last example (starting at around line 350) may be describing this\nsituation, but it was not very clear to me.\n\n    Keep changes in working tree while discarding some previous commits::\n\n    Suppose you are working on something and you commit it, and then you\n    continue working a bit more, but now you think that what you have in\n    your working tree should be in another branch that has nothing to do\n    with what you commited previously. You can start a new branch and\n    reset it while keeping the changes in your work tree.\n\n    ------------\n    $ git tag start\n    $ git branch branch1\n\nI take it that this is supposed to be \"checkout -b branch1\".\n\n    $ edit\n    $ git commit ...                            <1>\n    $ edit\n    $ git branch branch2                        <2>\n\nI take it that this is supposed to be \"checkout -b branch2\".\n\n    $ git reset --keep start                    <3>\n    ------------\n\n    <1> This commits your first edits in branch1.\n    <2> This creates branch2, but unfortunately it contains the previous\n    commit that you don't want in this branch.\n    <3> This removes the unwanted previous commit, but this keeps the\n    changes in your working tree.\n\nThe above sequence is not very convincing.  After you edited the second\ntime, you create branch2 and that is presumably because you realized that\nthe change in the work tree belongs to a separate topic.  It would be a\nlot more natural to do this:\n\n    $ git tag start ;# we do not have to tag, but just to make the\n                       remainder of the illustration easier to read...\n    $ git checkout -b branch1\n    $ edit\t    ;# do the work for the first topic\n    $ git commit    ;# and commit\n    $ edit          ;# start working more and then realize that the\n    \t\t       change belongs to a separate topic, and the previous\n                       commit is unrelated to that new topic\n    $ git checkout -b branch2 start \n    $ edit          ;# continue working\n    $ git commit    ;# and conclude it\n\nso the example makes the use of \"reset --keep\" look artificial.\n"},{"id":"136170","messageId":"201003042321.36240.trast@student.ethz.ch","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-03-04T22:21:35Z","receivedAt":"2010-03-04T22:21:35Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"On Thursday 04 March 2010 01:02:20 Junio C Hamano wrote:\n> \n> * tr/notes-display (2010-02-23) 11 commits\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 uses early parts of jh/notes; is used by sb/notes-parse-opt.)\n> \n> Didn't look too carefully except for the second one.\n\nI hope to find the time to make a reroll this weekend.  Thanks for\nyour patience...\n\nMeanwhile, I revived the automatic gmane-and-then-some notes\ngeneration bot I wrote a year ago: point your core.notesref (or\nnotes.displayref with the above series) at\n\n  git://repo.or.cz/git/trast.git notes/full\n\nor for a version that only supplies Message-ID and gmane permalink,\n\n  git://repo.or.cz/git/trast.git notes/terse\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"136172","messageId":"7vk4trlhim.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"7vmxynydac.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-05T00:49:21Z","receivedAt":"2010-03-05T00:49:21Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>     $ git branch branch2                        <2>\n>\n> I take it that this is supposed to be \"checkout -b branch2\".\n>\n>     $ git reset --keep start                    <3>\n>     ------------\n>\n>     <1> This commits your first edits in branch1.\n>     <2> This creates branch2, but unfortunately it contains the previous\n>     commit that you don't want in this branch.\n>     <3> This removes the unwanted previous commit, but this keeps the\n>     changes in your working tree.\n>\n> The above sequence is not very convincing.  After you edited the second\n> time, you create branch2 and that is presumably because you realized that\n> the change in the work tree belongs to a separate topic.  It would be a\n> lot more natural to do this:\n>\n>     $ git tag start ;# we do not have to tag, but just to make the\n>                        remainder of the illustration easier to read...\n>     $ git checkout -b branch1\n>     $ edit\t    ;# do the work for the first topic\n>     $ git commit    ;# and commit\n>     $ edit          ;# start working more and then realize that the\n>     \t\t       change belongs to a separate topic, and the previous\n>                        commit is unrelated to that new topic\n>     $ git checkout -b branch2 start \n>     $ edit          ;# continue working\n>     $ git commit    ;# and conclude it\n>\n> so the example makes the use of \"reset --keep\" look artificial.\n\nNah, what was I thinking.  If I rephrase your side note <2> and <3> a\nlittle bit, everything makes sense.  Perhaps like so:\n\n    <2> In the ideal world, you could have realized that the earlier\n    commit did not belong to the new topic when you created and switched\n    to branch2 (i.e. \"git checkout -b branch2 start\"), but nobody is\n    perfect.\n\n    <3> But you can use \"reset --keep\" to remove the unwanted commit after\n    you switched to \"branch2\".\n\nAnd it becomes very clear that \"reset --keep\" is a sensible way to recover\nfrom this mistake.  No need to do \"read-tree -m -u\" followed by \"reset\"\nanymore.\n\nDo you think I finally understood what \"reset --keep\" is about?\n"},{"id":"136174","messageId":"ca433831003041730w7ccbc953kad3b600e7b112e0e@mail.gmail.com","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2010-03-05T01:30:50Z","receivedAt":"2010-03-05T01:30:50Z","isPatch":false,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"On Wed, Mar 3, 2010 at 7:02 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> * ml/color-grep (2010-02-26) 3 commits\n>  - grep: Colorize selected, context, and function lines\n>  - grep: Colorize filename, line number, and separator\n>  - Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_*\n>\n> There was a comment about not special casing filename coloring?\n\nThe disagreement is whether --name-only output should be colored or\nnot.  In the patch, it is not, which I argue makes more sense.  When\n--name-only is given, the only thing output is filenames.  Having them\nall be the same color adds no information, and I personally find it\nannoying to see one big block of the same color. GNU grep does color\nthe filenames with --name-only.  Michael Witten argues that this makes\nthe output consistent: whenever it's a filename, it's colored. [1]  He\nalso thinks that matching GNU grep's behavior is important.  He didn't\nconvince me and I didn't convince him, so it would be nice to have\nmore opinions on this.\n"},{"id":"136175","messageId":"ca433831003041732k69c7cadcuf8f7feaabf3e372f@mail.gmail.com","threadId":"22899","inReplyTo":"ca433831003041730w7ccbc953kad3b600e7b112e0e@mail.gmail.com","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Mark Lodato","fromEmail":"lodatom@gmail.com","sentAt":"2010-03-05T01:32:08Z","receivedAt":"2010-03-05T01:32:08Z","isPatch":false,"sender":{"key":"lodatom@gmail.com","avatar":"https://avatars.githubusercontent.com/u/58860?v=4"},"body":"On Thu, Mar 4, 2010 at 8:30 PM, Mark Lodato <lodatom@gmail.com> wrote:\n> On Wed, Mar 3, 2010 at 7:02 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> * ml/color-grep (2010-02-26) 3 commits\n>>  - grep: Colorize selected, context, and function lines\n>>  - grep: Colorize filename, line number, and separator\n>>  - Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_*\n>>\n>> There was a comment about not special casing filename coloring?\n>\n> The disagreement is whether --name-only output should be colored or\n> not.  In the patch, it is not, which I argue makes more sense.  When\n> --name-only is given, the only thing output is filenames.  Having them\n> all be the same color adds no information, and I personally find it\n> annoying to see one big block of the same color. GNU grep does color\n> the filenames with --name-only.  Michael Witten argues that this makes\n> the output consistent: whenever it's a filename, it's colored. [1]  He\n> also thinks that matching GNU grep's behavior is important.  He didn't\n> convince me and I didn't convince him, so it would be nice to have\n> more opinions on this.\n\nSorry, forgot the footnote:\n\n[1] Except that GNU grep does not color the filename is \"Binary file\n<file> matches.\"  This patch does color it.\n"},{"id":"136182","messageId":"7v7hprh2ot.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"ca433831003041730w7ccbc953kad3b600e7b112e0e@mail.gmail.com","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-05T03:23:14Z","receivedAt":"2010-03-05T03:23:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mark Lodato <lodatom@gmail.com> writes:\n\n> The disagreement is whether --name-only output should be colored or\n> not.  In the patch, it is not, which I argue makes more sense.  When\n> --name-only is given, the only thing output is filenames.  Having them\n> all be the same color adds no information, and I personally find it\n> annoying to see one big block of the same color. GNU grep does color\n> the filenames with --name-only.  Michael Witten argues that this makes\n> the output consistent: whenever it's a filename, it's colored. [1]  He\n> also thinks that matching GNU grep's behavior is important.  He didn't\n> convince me and I didn't convince him, so it would be nice to have\n> more opinions on this.\n\nI don't have a very strong preference, but I would say painting filenames\nin --name-only output the same way would make more sense than not doing\nso, as it is obviously consistent if we paint the name of the file exactly\nthe same way whenever we write it at the leftmost column as the hit label,\nno matter what options are in effect, e.g. -c, -l, or nothing.\n\nAs to the coloring of <foo> in \"Binary file <foo> matches\", I don't think\nit matters very much which way you choose.  That string is an oddball to\nbegin with---it isn't even prefixed with the filename like normal \"hit\"\nis:\n\n    $ git grep Q t/test4*.png t/Makefile\n    Binary file t/test4012.png matches\n    t/Makefile:SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n    t/Makefile:     @echo \"*** $@ ***\"; GIT_CONFIG=.git/config ...\n    t/Makefile:     '$(SHELL_PATH_SQ)' ./aggregate-results.sh test-results/t*-*    \n\nand I think it is deliberately made an oddball, i.e. it shouldn't be like\nthis:\n\n    $ git grep Q t/test4*.png t/Makefile\n    t/test4012.png: Binary file t/test4012.png matches\n    t/Makefile:SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n    t/Makefile:     @echo \"*** $@ ***\"; GIT_CONFIG=.git/config ...\n    t/Makefile:     '$(SHELL_PATH_SQ)' ./aggregate-results.sh test-results/t*-*    \n\nbecause if you did so, you cannot tell if t/test4012.png is a binary file,\nor it has that matched string anymore (well you can---the string doesn't\nhave Q, but I think you know what I mean).\n\nThat makes me think that it is not even violating consistency if we treat\nthe <foo> in \"Binary file <foo> matches\" differently from the usual\nfilename label at the leftmost column.  We do not have to be consistent\nthere, as the whole point of the line being an oddball is because it\nfundamentally wants to be shown differently.\n\nOn the other hand, painting <foo> in the same \"filename\" color may make it\neasier to spot for color-loving people.\n\nIOW, you can argue both ways, and both argument equally makes sense.  That\nis why I don't think it matters very much.\n\nAnd in such a case, it is typically safer to follow existing practices if\nthere are any.  If GNU paints it, we should.  If GNU doesn't, we probably\nshouldn't.\n"},{"id":"136211","messageId":"20100305162521.GA25120@progeny.tock","threadId":"22899","inReplyTo":"7vk4trlhim.fsf@alter.siamese.dyndns.org","subject":"git reset --keep (Re: What's cooking in git.git (Mar 2010, #01; Wed, 03))","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-03-05T16:25:21Z","receivedAt":"2010-03-05T16:25:21Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Do you think I finally understood what \"reset --keep\" is about?\n\nProbably. :)  Let me take the opportunity to give some examples of what\nI am hoping to use it for, to see if I am crazy.\n\n> Nah, what was I thinking.  If I rephrase your side note <2> and <3> a\n> little bit, everything makes sense.  Perhaps like so:\n> \n>     <2> In the ideal world, you could have realized that the earlier\n>     commit did not belong to the new topic when you created and switched\n>     to branch2 (i.e. \"git checkout -b branch2 start\"), but nobody is\n>     perfect.\n> \n>     <3> But you can use \"reset --keep\" to remove the unwanted commit after\n>     you switched to \"branch2\".\n> \n> And it becomes very clear that \"reset --keep\" is a sensible way to recover\n> from this mistake.  No need to do \"read-tree -m -u\" followed by \"reset\"\n> anymore.\n\nYes, this (recovery from a wrong choice of starting commit for a new\nbranch) makes sense.  Here are some other planned uses:\n\n1. Helping people new to git.\n\nA person not very familiar with git comes to me asking how to undo\nthe last couple of commits.  After a quick conversation, it becomes\nclear that the commits in question were not pushed out to any public\nrepository and that this person does not feel it would be useful to\npublish the problem commits.\n\nCurrently, I would have to advise such a person to use\n\n\tgit reset --hard HEAD^^\n\nI would prefer to recommend\n\n\tgit reset --keep HEAD^^\n\nbecause if there are uncommitted changes then it will give a \"needs\nupdate\" message (right?) and I can help the person to deal with it.\n\n2. Splitting up a huge patch.\n\nSuppose I have a huge patch consisting of several unrelated changes\napplied to the work tree but not commited.  I want to split it into\nlogical changes, commiting each one, and when I am done I will use a\nloop reading from git rev-list to test all the resulting commits\nautomatically.  A workflow for this looks something like the\nfollowing:\n\n git checkout -b series1\n git add -p\n git commit\n git add -p\n git commit\n git checkout -b series2 appropriate-base\n git add -p\n git commit\n ...\n\nHaving 'git reset --keep' available would add some flexibility:\n\n * As you mentioned, reset --keep would let me recover from 'git\n   checkout -b' to the wrong commit.\n * As in example 1, if some part of the patch turns out to be a\n   bad idea after all, I can try to discard it.\n\nA 'git stash' might be worth avoiding in some cases because it touches\nunrelated files, which means wasted time rebuilding everything.\n\n3. Keeping unrelated extra changes around.\n\nSuppose I am Linus, and I keep on forgetting to update the version\nnumber in a file named version.h or something.  So I update it in\nadvance as soon as I remember, but I do not commit the change or\nregister it in the index because it is not time yet.\n\nThen in almost every instance when I would have normally used\n'reset --hard', I should use 'reset --keep' instead.  The only\nexception is when I am mean “screw it all, reset to a completely\nknown state”; in that case, I will have to update version.h by hand\nagain.\n"},{"id":"136215","messageId":"201003051832.16001.chriscool@tuxfamily.org","threadId":"22899","inReplyTo":"7vk4trlhim.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Mar 2010, #01; Wed, 03)","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2010-03-05T17:32:15Z","receivedAt":"2010-03-05T17:32:15Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Friday 05 March 2010 01:49:21 Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> >     $ git branch branch2                        <2>\n> >\n> > I take it that this is supposed to be \"checkout -b branch2\".\n> >\n> >     $ git reset --keep start                    <3>\n> >     ------------\n> >\n> >     <1> This commits your first edits in branch1.\n> >     <2> This creates branch2, but unfortunately it contains the previous\n> >     commit that you don't want in this branch.\n> >     <3> This removes the unwanted previous commit, but this keeps the\n> >     changes in your working tree.\n> >\n> > The above sequence is not very convincing.  After you edited the second\n> > time, you create branch2 and that is presumably because you realized that\n> > the change in the work tree belongs to a separate topic.  It would be a\n> > lot more natural to do this:\n> >\n> >     $ git tag start ;# we do not have to tag, but just to make the\n> >                        remainder of the illustration easier to read...\n> >     $ git checkout -b branch1\n> >     $ edit\t    ;# do the work for the first topic\n> >     $ git commit    ;# and commit\n> >     $ edit          ;# start working more and then realize that the\n> >     \t\t       change belongs to a separate topic, and the previous\n> >                        commit is unrelated to that new topic\n> >     $ git checkout -b branch2 start\n> >     $ edit          ;# continue working\n> >     $ git commit    ;# and conclude it\n> >\n> > so the example makes the use of \"reset --keep\" look artificial.\n> \n> Nah, what was I thinking.  If I rephrase your side note <2> and <3> a\n> little bit, everything makes sense.  Perhaps like so:\n> \n>     <2> In the ideal world, you could have realized that the earlier\n>     commit did not belong to the new topic when you created and switched\n>     to branch2 (i.e. \"git checkout -b branch2 start\"), but nobody is\n>     perfect.\n> \n>     <3> But you can use \"reset --keep\" to remove the unwanted commit after\n>     you switched to \"branch2\".\n> \n> And it becomes very clear that \"reset --keep\" is a sensible way to recover\n> from this mistake.  No need to do \"read-tree -m -u\" followed by \"reset\"\n> anymore.\n> \n> Do you think I finally understood what \"reset --keep\" is about?\n\nYes I think so. Thanks for that.\n\nI will rework the documentation patch according to your remarks and perhaps \nJonathan Nieder's remarks too.\n\nThanks both,\nChristian.\n"},{"id":"136220","messageId":"201003052208.15837.chriscool@tuxfamily.org","threadId":"22899","inReplyTo":"20100305162521.GA25120@progeny.tock","subject":"Re: git reset --keep (Re: What's cooking in git.git (Mar 2010, #01; Wed, 03))","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2010-03-05T21:08:15Z","receivedAt":"2010-03-05T21:08:15Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Friday 05 March 2010 17:25:21 Jonathan Nieder wrote:\n>\n> 1. Helping people new to git.\n> \n> A person not very familiar with git comes to me asking how to undo\n> the last couple of commits.  After a quick conversation, it becomes\n> clear that the commits in question were not pushed out to any public\n> repository and that this person does not feel it would be useful to\n> publish the problem commits.\n> \n> Currently, I would have to advise such a person to use\n> \n> \tgit reset --hard HEAD^^\n> \n> I would prefer to recommend\n> \n> \tgit reset --keep HEAD^^\n> \n> because if there are uncommitted changes then it will give a \"needs\n> update\" message (right?) and I can help the person to deal with it.\n\nIf the uncommited changes are in files that are not touched by the discarded \ncommits then it will silently work and will keep your uncommited changes.\nIf the uncommited changes are in files touched by the discarded commits then it \nwill fail with an error message like this:\n\nerror: Entry 'foo' not uptodate. Cannot merge.\nfatal: Could not reset index file to revision 'HEAD^^'.\n\nBest regards,\nChristian.\n"},{"id":"136226","messageId":"20100306003946.GD27414@genesis.frugalware.org","threadId":"22899","inReplyTo":"7v7hptt0mr.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2010-03-06T00:39:48Z","receivedAt":"2010-03-06T00:39:48Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Wed, Mar 03, 2010 at 04:02:20PM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> * sd/format-patch-to (2010-02-17) 1 commit\n>  - Add 'git format-patch --to=' option and 'format.to' configuration variable.\n>\n> Shouldn't be too hard to add tests to t4014; other than that looked ready\n> for 'next'.\n\nHere is a patch that does so.\n\n t/t4014-format-patch.sh |   20 ++++++++++++++++++++\n 1 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex f2a2aaa..9305c98 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -531,6 +531,26 @@ test_expect_success 'format-patch --in-reply-to' '\n \tgrep \"^References: <baz@foo.bar>\" patch8\n '\n \n+test_expect_success 'command line to' '\n+\n+\tgit format-patch --to=\"R. E. Cipient <rcipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch9 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>\" patch9\n+'\n+\n+test_expect_success 'configuration to' '\n+\n+\tgit config --replace-all format.to \"R. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --stdout master..side | sed -e \"/^\\$/q\" >patch10 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>\" patch10\n+'\n+\n+test_expect_success 'additional command line to' '\n+\n+\tgit format-patch --to=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch11 &&\n+\tgrep \"^To: R. E. Cipient <rcipient@example.com>,\\$\" patch11 &&\n+\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" patch11\n+'\n+\n test_expect_success 'format-patch --signoff' '\n \tgit format-patch -1 --signoff --stdout |\n \tgrep \"^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>\"\n-- \n1.7.0\n"},{"id":"136227","messageId":"7vr5nykx55.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"20100306003946.GD27414@genesis.frugalware.org","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-06T02:21:42Z","receivedAt":"2010-03-06T02:21:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> +test_expect_success 'additional command line to' '\n> +\n> +\tgit format-patch --to=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch11 &&\n> +\tgrep \"^To: R. E. Cipient <rcipient@example.com>,\\$\" patch11 &&\n> +\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" patch11\n> +'\n\nThis reveals that --to does not follow the usual rule to override\ncorresponding configuration.  Is that really what we want?  IOW, when the\ncommand line says scipient, shouldn't we stop sending to recipient that\ncomes from the configuration?  How else would a user override this?\n\nSo I guess the topic wasn't ready for 'next' yet, after all.\n\nThanks.\n"},{"id":"136327","messageId":"20100306210650.GO27414@genesis.frugalware.org","threadId":"22899","inReplyTo":"7vr5nykx55.fsf@alter.siamese.dyndns.org","subject":"[PATCH] format-patch --to: overwrite format.to contents, don't append it","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2010-03-06T21:06:50Z","receivedAt":"2010-03-06T21:06:50Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nOn Fri, Mar 05, 2010 at 06:21:42PM -0800, Junio C Hamano <gitster@pobox.com> wrote:\n> This reveals that --to does not follow the usual rule to override\n> corresponding configuration.  Is that really what we want?  IOW, when the\n> command line says scipient, shouldn't we stop sending to recipient that\n> comes from the configuration?  How else would a user override this?\n\nFair enough, here is a patch to update both the testcase and the code to\nthe wished behaviour.\n\n builtin-log.c           |    6 ++++++\n t/t4014-format-patch.sh |    5 +++--\n 2 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 5d23a67..cc28357 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -465,6 +465,7 @@ static int extra_hdr_alloc;\n static char **extra_to;\n static int extra_to_nr;\n static int extra_to_alloc;\n+static int extra_to_config = 0;\n \n static char **extra_cc;\n static int extra_cc_nr;\n@@ -507,6 +508,7 @@ static int git_format_config(const char *var, const char *value, void *cb)\n \tif (!strcmp(var, \"format.to\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n+\t\textra_to_config = 1;\n \t\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n \t\textra_to[extra_to_nr++] = xstrdup(value);\n \t\treturn 0;\n@@ -884,6 +886,10 @@ static int header_callback(const struct option *opt, const char *arg, int unset)\n \n static int to_callback(const struct option *opt, const char *arg, int unset)\n {\n+\tif (extra_to_config) {\n+\t\textra_to_config = 0;\n+\t\textra_to_nr = 0;\n+\t}\n \tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n \textra_to[extra_to_nr++] = xstrdup(arg);\n \treturn 0;\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 9305c98..6fc071a 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -546,9 +546,10 @@ test_expect_success 'configuration to' '\n \n test_expect_success 'additional command line to' '\n \n+\tgit config --unset-all format.headers &&\n \tgit format-patch --to=\"S. E. Cipient <scipient@example.com>\" --stdout master..side | sed -e \"/^\\$/q\" >patch11 &&\n-\tgrep \"^To: R. E. Cipient <rcipient@example.com>,\\$\" patch11 &&\n-\tgrep \"^ *S. E. Cipient <scipient@example.com>\\$\" patch11\n+\t! grep \"R. E. Cipient <rcipient@example.com>\" patch11 &&\n+\tgrep \"^To: S. E. Cipient <scipient@example.com>\\$\" patch11\n '\n \n test_expect_success 'format-patch --signoff' '\n-- \n1.7.0\n"},{"id":"136254","messageId":"4B92EDFA.1000602@gmail.com","threadId":"22899","inReplyTo":"7vr5nykx55.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T00:06:18Z","receivedAt":"2010-03-07T00:06:18Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 03/05/2010 06:21 PM, Junio C Hamano wrote:\n> This reveals that --to does not follow the usual rule to override\n> corresponding configuration.  Is that really what we want?  IOW, when the\n> command line says scipient, shouldn't we stop sending to recipient that\n> comes from the configuration?  How else would a user override this?\n>\n> So I guess the topic wasn't ready for 'next' yet, after all.\n>   \n\nThe same applies to the fomat.headers and format.cc config options. How\nis this different?\n"},{"id":"136255","messageId":"20100307012052.GQ27414@genesis.frugalware.org","threadId":"22899","inReplyTo":"4B92EDFA.1000602@gmail.com","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2010-03-07T01:20:53Z","receivedAt":"2010-03-07T01:20:53Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Mar 06, 2010 at 04:06:18PM -0800, Stephen Boyd <bebarino@gmail.com> wrote:\n> The same applies to the fomat.headers and format.cc config options. How\n> is this different?\n\nI think having multiple Cc: and custom headers is a regular use case,\nwhile having multiple To: headers is rare.\n"},{"id":"136267","messageId":"7vaaukdch2.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"4B92EDFA.1000602@gmail.com","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-07T03:42:17Z","receivedAt":"2010-03-07T03:42:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> On 03/05/2010 06:21 PM, Junio C Hamano wrote:\n>> This reveals that --to does not follow the usual rule to override\n>> corresponding configuration.  Is that really what we want?  IOW, when the\n>> command line says scipient, shouldn't we stop sending to recipient that\n>> comes from the configuration?  How else would a user override this?\n>>\n>> So I guess the topic wasn't ready for 'next' yet, after all.\n>\n> The same applies to the fomat.headers and format.cc config options. How\n> is this different?\n\nNot different.  Perhaps we should fix them now you noticed they share the\nsame problem?\n\nAn obvious alternative is to keep format.to not get overriden by --to as\nthe original patch did; that would at least make the handling between\nconfig and option consistent inside the command, but at the same time, it\nmeans format-patch behaves differently from everything else in git.\n\nI don't have strong preference either way myself, and while I know\n\"fixing\" the ones you listed would affect existing users, I have this\nsuspicion that it wouldn't be too big a problem.  After all, format-patch\ndoes not _send_ mails; these MUA-like \"features\" doesn't belong to the\nprogram, and nobody should be relying on them heavily in the first place.\n"},{"id":"136244","messageId":"4B937559.6000302@gmail.com","threadId":"22899","inReplyTo":"7vaaukdch2.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T09:43:53Z","receivedAt":"2010-03-07T09:43:53Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 03/06/2010 07:42 PM, Junio C Hamano wrote:\n> Stephen Boyd <bebarino@gmail.com> writes:\n>\n>   \n>> The same applies to the fomat.headers and format.cc config options. How\n>> is this different?\n>>     \n> Not different.  Perhaps we should fix them now you noticed they share the\n> same problem?\n>\n>\n> An obvious alternative is to keep format.to not get overriden by --to as\n> the original patch did; that would at least make the handling between\n> config and option consistent inside the command, but at the same time, it\n> means format-patch behaves differently from everything else in git.\n>   \n\nActually, I think the same applies to send-email too? There's\nsendemail.to and sendemail.cc which can't be overridden. At least the\nemail associated commands are all quirky ;-)\n\nHonestly though, I think you're right about fixing them. We have the\noption of making them consistent with the rest of git with a little bit\nof work. If you say --no-cc or --no-add-headers or --no-to the\nrespective config should be overriden. If you say --to or --cc or\n--add-headers it should be appended. I doubt anyone would find that\nsurprising since --no-* doesn't do anything right now.\n"},{"id":"136347","messageId":"7vk4torn8j.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"4B937559.6000302@gmail.com","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-07T18:38:20Z","receivedAt":"2010-03-07T18:38:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> ... We have the\n> option of making them consistent with the rest of git with a little bit\n> of work. If you say --no-cc or --no-add-headers or --no-to the\n> respective config should be overriden. If you say --to or --cc or\n> --add-headers it should be appended. I doubt anyone would find that\n> surprising since --no-* doesn't do anything right now.\n\nThat sounds like a sensible and practical way out, as it won't break\nexisting setup that expects the additive behaviour these two command\nsomehow ended up with, while allowing --no-* to override the config when\nnecessary.\n"},{"id":"136355","messageId":"1267997598-20815-1-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"[PATCH 0/4] format-patch and send-email ignoring config settings","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:33:14Z","receivedAt":"2010-03-07T21:33:14Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Ok this does the --no-* thing to allow the user to say \"I want to ignore\nthe config settings this time\". I couldn't think of a better way to\nimplement appending and overriding without having to say --no-to and --to\nin the same command line invocation. Seems to work ok though.\n\nMy perl is pretty bad so please check send-email. \n\nYou get an ancient bugfix for free too. Enjoy.\n\nStephen Boyd (4):\n  send-email: actually add bcc headers\n  format-patch: use a string_list for headers\n  format-patch: add --no-cc, --no-to, and --no-add-headers\n  send-email: add --no-cc, --no-to, and --no-bcc\n\n builtin-log.c           |   91 ++++++++++++++++++++++++----------------------\n git-send-email.perl     |   19 ++++++++--\n t/t4014-format-patch.sh |   38 +++++++++++++++++++\n t/t9001-send-email.sh   |   39 ++++++++++++++++++++\n 4 files changed, 139 insertions(+), 48 deletions(-)\n"},{"id":"136357","messageId":"1267997598-20815-2-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/4] send-email: actually add bcc headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:33:15Z","receivedAt":"2010-03-07T21:33:15Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"This bug looks ancient. In fact it doesn't look like --bcc ever worked\neven when it was introduced in 5806324 (Add support for --bcc to\ngit-send-email., 2006-05-29).\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-send-email.perl   |    7 ++++++-\n t/t9001-send-email.sh |    1 +\n 2 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e05455f..3d9c832 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -856,11 +856,16 @@ sub send_message\n \tif ($cc ne '') {\n \t\t$ccline = \"\\nCc: $cc\";\n \t}\n+\tmy $bcc = join(\",\\n\\t\", unique_email_list(@bcclist));\n+\tmy $bccline = \"\";\n+\tif ($bcc ne '') {\n+\t\t$bccline = \"\\nBcc: $bcc\";\n+\t}\n \tmy $sanitized_sender = sanitize_address($sender);\n \tmake_message_id() unless defined($message_id);\n \n \tmy $header = \"From: $sanitized_sender\n-To: $to${ccline}\n+To: $to${ccline}${bccline}\n Subject: $subject\n Date: $date\n Message-Id: $message_id\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c09f375..db91721 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -149,6 +149,7 @@ Cc: cc@example.com,\n \tA <author@example.com>,\n \tOne <one@example.com>,\n \ttwo@example.com\n+Bcc: bcc@example.com\n Subject: [PATCH 1/1] Second.\n Date: DATE-STRING\n Message-Id: MESSAGE-ID-STRING\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136356","messageId":"1267997598-20815-3-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"[PATCH 2/4] format-patch: use a string_list for headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:33:16Z","receivedAt":"2010-03-07T21:33:16Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"In the next patch we'll need to clear the header lists if the user\nspecifies --no-add-headers or --no-to or --no-cc. This actually cuts\ndown on the code a bit too.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n\nI had a patch like this but using strbuf's instead. I couldn't find it...\n\n builtin-log.c |   70 +++++++++++++++++++++++++-------------------------------\n 1 files changed, 31 insertions(+), 39 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 5d23a67..dd8369f 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -458,35 +458,28 @@ static int auto_number = 1;\n \n static char *default_attach = NULL;\n \n-static char **extra_hdr;\n-static int extra_hdr_nr;\n-static int extra_hdr_alloc;\n-\n-static char **extra_to;\n-static int extra_to_nr;\n-static int extra_to_alloc;\n-\n-static char **extra_cc;\n-static int extra_cc_nr;\n-static int extra_cc_alloc;\n+static struct string_list extra_hdr = { .strdup_strings = 1 };\n+static struct string_list extra_to = { .strdup_strings = 1 };\n+static struct string_list extra_cc = { .strdup_strings = 1 };\n \n static void add_header(const char *value)\n {\n+\tstruct string_list_item *i;\n \tint len = strlen(value);\n \twhile (len && value[len - 1] == '\\n')\n \t\tlen--;\n+\n \tif (!strncasecmp(value, \"to: \", 4)) {\n-\t\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\t\textra_to[extra_to_nr++] = xstrndup(value + 4, len - 4);\n-\t\treturn;\n+\t\ti = string_list_append(value + 4, &extra_to);\n+\t\tlen -= 4;\n+\t} else if (!strncasecmp(value, \"cc: \", 4)) {\n+\t\ti = string_list_append(value + 4, &extra_cc);\n+\t\tlen -= 4;\n+\t} else {\n+\t\ti =string_list_append(value, &extra_hdr);\n \t}\n-\tif (!strncasecmp(value, \"cc: \", 4)) {\n-\t\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\t\textra_cc[extra_cc_nr++] = xstrndup(value + 4, len - 4);\n-\t\treturn;\n-\t}\n-\tALLOC_GROW(extra_hdr, extra_hdr_nr + 1, extra_hdr_alloc);\n-\textra_hdr[extra_hdr_nr++] = xstrndup(value, len);\n+\n+\ti->string[len] = '\\0';\n }\n \n #define THREAD_SHALLOW 1\n@@ -507,15 +500,13 @@ static int git_format_config(const char *var, const char *value, void *cb)\n \tif (!strcmp(var, \"format.to\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n-\t\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\t\textra_to[extra_to_nr++] = xstrdup(value);\n+\t\tstring_list_append(value, &extra_to);\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"format.cc\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n-\t\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\t\textra_cc[extra_cc_nr++] = xstrdup(value);\n+\t\tstring_list_append(value, &extra_cc);\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\n@@ -884,15 +875,13 @@ static int header_callback(const struct option *opt, const char *arg, int unset)\n \n static int to_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\textra_to[extra_to_nr++] = xstrdup(arg);\n+\tstring_list_append(arg, &extra_to);\n \treturn 0;\n }\n \n static int cc_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\textra_cc[extra_cc_nr++] = xstrdup(arg);\n+\tstring_list_append(arg, &extra_cc);\n \treturn 0;\n }\n \n@@ -1008,29 +997,29 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tadd_signoff = xmemdupz(committer, endpos - committer + 1);\n \t}\n \n-\tfor (i = 0; i < extra_hdr_nr; i++) {\n-\t\tstrbuf_addstr(&buf, extra_hdr[i]);\n+\tfor (i = 0; i < extra_hdr.nr; i++) {\n+\t\tstrbuf_addstr(&buf, extra_hdr.items[i].string);\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n \n-\tif (extra_to_nr)\n+\tif (extra_to.nr)\n \t\tstrbuf_addstr(&buf, \"To: \");\n-\tfor (i = 0; i < extra_to_nr; i++) {\n+\tfor (i = 0; i < extra_to.nr; i++) {\n \t\tif (i)\n \t\t\tstrbuf_addstr(&buf, \"    \");\n-\t\tstrbuf_addstr(&buf, extra_to[i]);\n-\t\tif (i + 1 < extra_to_nr)\n+\t\tstrbuf_addstr(&buf, extra_to.items[i].string);\n+\t\tif (i + 1 < extra_to.nr)\n \t\t\tstrbuf_addch(&buf, ',');\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n \n-\tif (extra_cc_nr)\n+\tif (extra_cc.nr)\n \t\tstrbuf_addstr(&buf, \"Cc: \");\n-\tfor (i = 0; i < extra_cc_nr; i++) {\n+\tfor (i = 0; i < extra_cc.nr; i++) {\n \t\tif (i)\n \t\t\tstrbuf_addstr(&buf, \"    \");\n-\t\tstrbuf_addstr(&buf, extra_cc[i]);\n-\t\tif (i + 1 < extra_cc_nr)\n+\t\tstrbuf_addstr(&buf, extra_cc.items[i].string);\n+\t\tif (i + 1 < extra_cc.nr)\n \t\t\tstrbuf_addch(&buf, ',');\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n@@ -1239,6 +1228,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\tfclose(stdout);\n \t}\n \tfree(list);\n+\tstring_list_clear(&extra_to, 0);\n+\tstring_list_clear(&extra_cc, 0);\n+\tstring_list_clear(&extra_hdr, 0);\n \tif (ignore_if_in_upstream)\n \t\tfree_patch_ids(&ids);\n \treturn 0;\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136359","messageId":"1267997598-20815-4-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"[PATCH 3/4] format-patch: add --no-cc, --no-to, and --no-add-headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:33:17Z","receivedAt":"2010-03-07T21:33:17Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"These new options allow users to override their config settings for\nformat.cc, format.to and format.headers respectively. These options\nonly make git ignore the config settings and any previous command line\noptions, so you'll still have to add more command line options to add\nextra headers. For example,\n\n\t$ cat .git/config\n\t[format]\n\t\tto = Someone <someone@out.there>\n\t$ git format-patch -1 --no-to --to=\"Someone Else <else@out.there>\"\n\nwould format a patch addressed to \"Someone Else\" and not \"Someone\".\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n builtin-log.c           |   25 ++++++++++++++++++-------\n t/t4014-format-patch.sh |   38 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 56 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex dd8369f..00cddcc 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -869,19 +869,31 @@ static int inline_callback(const struct option *opt, const char *arg, int unset)\n \n static int header_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tadd_header(arg);\n+\tif (unset) {\n+\t\tstring_list_clear(&extra_hdr, 0);\n+\t\tstring_list_clear(&extra_to, 0);\n+\t\tstring_list_clear(&extra_cc, 0);\n+\t} else {\n+\t    add_header(arg);\n+\t}\n \treturn 0;\n }\n \n static int to_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tstring_list_append(arg, &extra_to);\n+\tif (unset)\n+\t\tstring_list_clear(&extra_to, 0);\n+\telse\n+\t\tstring_list_append(arg, &extra_to);\n \treturn 0;\n }\n \n static int cc_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tstring_list_append(arg, &extra_cc);\n+\tif (unset)\n+\t\tstring_list_clear(&extra_cc, 0);\n+\telse\n+\t\tstring_list_append(arg, &extra_cc);\n \treturn 0;\n }\n \n@@ -940,12 +952,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t  PARSE_OPT_NONEG | PARSE_OPT_NOARG },\n \t\tOPT_GROUP(\"Messaging\"),\n \t\t{ OPTION_CALLBACK, 0, \"add-header\", NULL, \"header\",\n-\t\t\t    \"add email header\", PARSE_OPT_NONEG,\n-\t\t\t    header_callback },\n+\t\t\t    \"add email header\", 0, header_callback },\n \t\t{ OPTION_CALLBACK, 0, \"to\", NULL, \"email\", \"add To: header\",\n-\t\t\t    PARSE_OPT_NONEG, to_callback },\n+\t\t\t    0, to_callback },\n \t\t{ OPTION_CALLBACK, 0, \"cc\", NULL, \"email\", \"add Cc: header\",\n-\t\t\t    PARSE_OPT_NONEG, cc_callback },\n+\t\t\t    0, cc_callback },\n \t\tOPT_STRING(0, \"in-reply-to\", &in_reply_to, \"message-id\",\n \t\t\t    \"make first mail a reply to <message-id>\"),\n \t\t{ OPTION_CALLBACK, 0, \"attach\", &rev, \"boundary\",\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 830ddb0..c7b6256 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -157,6 +157,44 @@ test_expect_success 'configuration To: header' '\n \tgrep \"^To: R. E. Cipient <rcipient@example.com>\\$\" patch9\n '\n \n+test_expect_success '--no-to overrides config.to' '\n+\n+\tgit config --replace-all format.to \\\n+\t\t\"R. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-to --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch10 &&\n+\t! grep \"^To: R. E. Cipient <rcipient@example.com>\\$\" patch10\n+'\n+\n+test_expect_success '--no-to and --to replaces config.to' '\n+\n+\tgit config --replace-all format.to \\\n+\t\t\"Someone <someone@out.there>\" &&\n+\tgit format-patch --no-to --to=\"Someone Else <else@out.there>\" \\\n+\t\t--stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch11 &&\n+\t! grep \"^To: Someone <someone@out.there>\\$\" patch11 &&\n+\tgrep \"^To: Someone Else <else@out.there>\\$\" patch11\n+'\n+\n+test_expect_success '--no-cc overrides config.cc' '\n+\n+\tgit config --replace-all format.cc \\\n+\t\t\"C. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-cc --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch12 &&\n+\t! grep \"^Cc: C. E. Cipient <rcipient@example.com>\\$\" patch12\n+'\n+\n+test_expect_success '--no-add-headers overrides config.headers' '\n+\n+\tgit config --replace-all format.headers \\\n+\t\t\"Header1: B. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-add-headers --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch13 &&\n+\t! grep \"^Header1: B. E. Cipient <rcipient@example.com>\\$\" patch13\n+'\n+\n test_expect_success 'multiple files' '\n \n \trm -rf patches/ &&\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136358","messageId":"1267997598-20815-5-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"[PATCH 4/4] send-email: add --no-cc, --no-to, and --no-bcc","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:33:18Z","receivedAt":"2010-03-07T21:33:18Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"There's no way to override the sendemail.to, sendemail.cc, and\nsendemail.bcc config settings. Add options allowing the user to tell\ngit to ignore the config settings and take whatever is on the command\nline.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-send-email.perl   |   14 ++++++++++----\n t/t9001-send-email.sh |   38 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 48 insertions(+), 4 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 3d9c832..0a91f4a 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -47,9 +47,9 @@ git send-email [options] <file | directory | rev-list options >\n \n   Composing:\n     --from                  <str>  * Email From:\n-    --to                    <str>  * Email To:\n-    --cc                    <str>  * Email Cc:\n-    --bcc                   <str>  * Email Bcc:\n+    --[no-]to               <str>  * Email To:\n+    --[no-]cc               <str>  * Email Cc:\n+    --[no-]bcc              <str>  * Email Bcc:\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n     --annotate                     * Review each patch that will be sent in an editor.\n@@ -135,7 +135,7 @@ sub unique_email_list(@);\n sub cleanup_compose_files();\n \n # Variables we fill in automatically, or via prompting:\n-my (@to,@cc,@initial_cc,@bcclist,@xh,\n+my (@to,$no_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,\n \t$initial_reply_to,$initial_subject,@files,\n \t$author,$sender,$smtp_authpass,$annotate,$compose,$time);\n \n@@ -261,8 +261,11 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n                     \"in-reply-to=s\" => \\$initial_reply_to,\n \t\t    \"subject=s\" => \\$initial_subject,\n \t\t    \"to=s\" => \\@to,\n+\t\t    \"no-to\" => \\$no_to,\n \t\t    \"cc=s\" => \\@initial_cc,\n+\t\t    \"no-cc\" => \\$no_cc,\n \t\t    \"bcc=s\" => \\@bcclist,\n+\t\t    \"no-bcc\" => \\$no_bcc,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n@@ -305,6 +308,9 @@ sub read_config {\n \n \tforeach my $setting (keys %config_settings) {\n \t\tmy $target = $config_settings{$setting};\n+\t\tnext if $setting eq \"to\" and defined $no_to;\n+\t\tnext if $setting eq \"cc\" and defined $no_cc;\n+\t\tnext if $setting eq \"bcc\" and defined $no_bcc;\n \t\tif (ref($target) eq \"ARRAY\") {\n \t\t\tunless (@$target) {\n \t\t\t\tmy @values = Git::config(@repo, \"$prefix.$setting\");\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex db91721..60bca7e 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -853,4 +853,42 @@ test_expect_success 'no warning with sendemail.chainreplyto = true' '\n \t! grep \"no-chain-reply-to\" errors\n '\n \n+test_expect_success '--no-to overrides sendemail.to' '\n+\tgit config --replace-all sendemail.to \"Somebody <somebody@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-to \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"To: nobody@example.com\" stdout &&\n+\t! grep \"To: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success '--no-cc overrides sendemail.cc' '\n+\tgit config --replace-all sendemail.cc \"Somebody <somebody@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-cc \\\n+\t\t--cc=bodies@example.com \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"Cc: bodies@example.com\" stdout &&\n+\t! grep \"Cc: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success '--no-bcc overrides sendemail.bcc' '\n+\tgit config --replace-all sendemail.bcc \"Somebody <somebody@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-bcc \\\n+\t\t--bcc=bodies@example.com \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"Bcc: bodies@example.com\" stdout &&\n+\t! grep \"Bcc: Somebody <somebody@ex.com>\" stdout\n+'\n+\n test_done\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136361","messageId":"40aa078e1003071344h5ef4358aif7888afdad1b4fc6@mail.gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-3-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH 2/4] format-patch: use a string_list for headers","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@googlemail.com","sentAt":"2010-03-07T21:44:14Z","receivedAt":"2010-03-07T21:44:14Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Mar 7, 2010 at 10:33 PM, Stephen Boyd <bebarino@gmail.com> wrote:\n> +static struct string_list extra_hdr = { .strdup_strings = 1 };\n> +static struct string_list extra_to = { .strdup_strings = 1 };\n> +static struct string_list extra_cc = { .strdup_strings = 1 };\n>\n\nDo we really use this C99 feature (designated initializers)? I think\nit will break MSVC builds, at least... Perhaps some other non-gcc\nplatforms as well?\n\n-- \nErik \"kusma\" Faye-Lund\n"},{"id":"136362","messageId":"4B942065.1000406@gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-2-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH 1/4] send-email: actually add bcc headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:53:41Z","receivedAt":"2010-03-07T21:53:41Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 03/07/2010 01:33 PM, Stephen Boyd wrote:\n> This bug looks ancient. In fact it doesn't look like --bcc ever worked\n> even when it was introduced in 5806324 (Add support for --bcc to\n> git-send-email., 2006-05-29).\n>\n> Signed-off-by: Stephen Boyd <bebarino@gmail.com>\n>   \n\nHaha. Nevermind this one, I'm blind and can't read. Need to figure out a\nway to test the bcc list though.\n"},{"id":"136363","messageId":"4B9420AC.1030104@gmail.com","threadId":"22899","inReplyTo":"40aa078e1003071344h5ef4358aif7888afdad1b4fc6@mail.gmail.com","subject":"Re: [PATCH 2/4] format-patch: use a string_list for headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T21:54:52Z","receivedAt":"2010-03-07T21:54:52Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 03/07/2010 01:44 PM, Erik Faye-Lund wrote:\n> On Sun, Mar 7, 2010 at 10:33 PM, Stephen Boyd <bebarino@gmail.com> wrote:\n>   \n>> +static struct string_list extra_hdr = { .strdup_strings = 1 };\n>> +static struct string_list extra_to = { .strdup_strings = 1 };\n>> +static struct string_list extra_cc = { .strdup_strings = 1 };\n>>\n>>     \n> Do we really use this C99 feature (designated initializers)? I think\n> it will break MSVC builds, at least... Perhaps some other non-gcc\n> platforms as well?\n>   \n\nFigured as much. Not a problem to fix. Thanks.\n"},{"id":"136364","messageId":"alpine.DEB.1.00.1003072313130.7596@pacific.mpi-cbg.de","threadId":"22899","inReplyTo":"40aa078e1003071344h5ef4358aif7888afdad1b4fc6@mail.gmail.com","subject":"Re: [PATCH 2/4] format-patch: use a string_list for headers","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2010-03-07T22:13:28Z","receivedAt":"2010-03-07T22:13:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 7 Mar 2010, Erik Faye-Lund wrote:\n\n> On Sun, Mar 7, 2010 at 10:33 PM, Stephen Boyd <bebarino@gmail.com> wrote:\n> > +static struct string_list extra_hdr = { .strdup_strings = 1 };\n> > +static struct string_list extra_to = { .strdup_strings = 1 };\n> > +static struct string_list extra_cc = { .strdup_strings = 1 };\n> >\n> \n> Do we really use this C99 feature (designated initializers)? I think\n> it will break MSVC builds, at least... Perhaps some other non-gcc\n> platforms as well?\n\nhttp://repo.or.cz/w/git.git/blob?f=Documentation/SubmittingPatches#l84\n\nCiao,\nDscho\n"},{"id":"136370","messageId":"1268002008-13426-1-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 0/3] format-patch and send-email ignoring config settings","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T22:46:45Z","receivedAt":"2010-03-07T22:46:45Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Changes since v1:\n * No more initializers \n * Better tests for send-email\n * Dropped first patch\n\nStephen Boyd (3):\n  format-patch: use a string_list for headers\n  format-patch: add --no-cc, --no-to, and --no-add-headers\n  send-email: add --no-cc, --no-to, and --no-bcc\n\n builtin-log.c           |   94 +++++++++++++++++++++++++----------------------\n git-send-email.perl     |   14 +++++--\n t/t4014-format-patch.sh |   38 +++++++++++++++++++\n t/t9001-send-email.sh   |   66 +++++++++++++++++++++++++++++++++\n 4 files changed, 164 insertions(+), 48 deletions(-)\n"},{"id":"136366","messageId":"1268002008-13426-2-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 1/3] format-patch: use a string_list for headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T22:46:46Z","receivedAt":"2010-03-07T22:46:46Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"In the next patch we'll need to clear the header lists if the user\nspecifies --no-add-headers or --no-to or --no-cc. This actually cuts\ndown on the code a bit too.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n builtin-log.c |   73 ++++++++++++++++++++++++++------------------------------\n 1 files changed, 34 insertions(+), 39 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 5d23a67..ca241af 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -458,35 +458,28 @@ static int auto_number = 1;\n \n static char *default_attach = NULL;\n \n-static char **extra_hdr;\n-static int extra_hdr_nr;\n-static int extra_hdr_alloc;\n-\n-static char **extra_to;\n-static int extra_to_nr;\n-static int extra_to_alloc;\n-\n-static char **extra_cc;\n-static int extra_cc_nr;\n-static int extra_cc_alloc;\n+static struct string_list extra_hdr;\n+static struct string_list extra_to;\n+static struct string_list extra_cc;\n \n static void add_header(const char *value)\n {\n+\tstruct string_list_item *i;\n \tint len = strlen(value);\n \twhile (len && value[len - 1] == '\\n')\n \t\tlen--;\n+\n \tif (!strncasecmp(value, \"to: \", 4)) {\n-\t\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\t\textra_to[extra_to_nr++] = xstrndup(value + 4, len - 4);\n-\t\treturn;\n+\t\ti = string_list_append(value + 4, &extra_to);\n+\t\tlen -= 4;\n+\t} else if (!strncasecmp(value, \"cc: \", 4)) {\n+\t\ti = string_list_append(value + 4, &extra_cc);\n+\t\tlen -= 4;\n+\t} else {\n+\t\ti =string_list_append(value, &extra_hdr);\n \t}\n-\tif (!strncasecmp(value, \"cc: \", 4)) {\n-\t\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\t\textra_cc[extra_cc_nr++] = xstrndup(value + 4, len - 4);\n-\t\treturn;\n-\t}\n-\tALLOC_GROW(extra_hdr, extra_hdr_nr + 1, extra_hdr_alloc);\n-\textra_hdr[extra_hdr_nr++] = xstrndup(value, len);\n+\n+\ti->string[len] = '\\0';\n }\n \n #define THREAD_SHALLOW 1\n@@ -507,15 +500,13 @@ static int git_format_config(const char *var, const char *value, void *cb)\n \tif (!strcmp(var, \"format.to\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n-\t\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\t\textra_to[extra_to_nr++] = xstrdup(value);\n+\t\tstring_list_append(value, &extra_to);\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"format.cc\")) {\n \t\tif (!value)\n \t\t\treturn config_error_nonbool(var);\n-\t\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\t\textra_cc[extra_cc_nr++] = xstrdup(value);\n+\t\tstring_list_append(value, &extra_cc);\n \t\treturn 0;\n \t}\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\n@@ -884,15 +875,13 @@ static int header_callback(const struct option *opt, const char *arg, int unset)\n \n static int to_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tALLOC_GROW(extra_to, extra_to_nr + 1, extra_to_alloc);\n-\textra_to[extra_to_nr++] = xstrdup(arg);\n+\tstring_list_append(arg, &extra_to);\n \treturn 0;\n }\n \n static int cc_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc);\n-\textra_cc[extra_cc_nr++] = xstrdup(arg);\n+\tstring_list_append(arg, &extra_cc);\n \treturn 0;\n }\n \n@@ -972,6 +961,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tOPT_END()\n \t};\n \n+\textra_hdr.strdup_strings = 1;\n+\textra_to.strdup_strings = 1;\n+\textra_cc.strdup_strings = 1;\n \tgit_config(git_format_config, NULL);\n \tinit_revisions(&rev, prefix);\n \trev.commit_format = CMIT_FMT_EMAIL;\n@@ -1008,29 +1000,29 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\tadd_signoff = xmemdupz(committer, endpos - committer + 1);\n \t}\n \n-\tfor (i = 0; i < extra_hdr_nr; i++) {\n-\t\tstrbuf_addstr(&buf, extra_hdr[i]);\n+\tfor (i = 0; i < extra_hdr.nr; i++) {\n+\t\tstrbuf_addstr(&buf, extra_hdr.items[i].string);\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n \n-\tif (extra_to_nr)\n+\tif (extra_to.nr)\n \t\tstrbuf_addstr(&buf, \"To: \");\n-\tfor (i = 0; i < extra_to_nr; i++) {\n+\tfor (i = 0; i < extra_to.nr; i++) {\n \t\tif (i)\n \t\t\tstrbuf_addstr(&buf, \"    \");\n-\t\tstrbuf_addstr(&buf, extra_to[i]);\n-\t\tif (i + 1 < extra_to_nr)\n+\t\tstrbuf_addstr(&buf, extra_to.items[i].string);\n+\t\tif (i + 1 < extra_to.nr)\n \t\t\tstrbuf_addch(&buf, ',');\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n \n-\tif (extra_cc_nr)\n+\tif (extra_cc.nr)\n \t\tstrbuf_addstr(&buf, \"Cc: \");\n-\tfor (i = 0; i < extra_cc_nr; i++) {\n+\tfor (i = 0; i < extra_cc.nr; i++) {\n \t\tif (i)\n \t\t\tstrbuf_addstr(&buf, \"    \");\n-\t\tstrbuf_addstr(&buf, extra_cc[i]);\n-\t\tif (i + 1 < extra_cc_nr)\n+\t\tstrbuf_addstr(&buf, extra_cc.items[i].string);\n+\t\tif (i + 1 < extra_cc.nr)\n \t\t\tstrbuf_addch(&buf, ',');\n \t\tstrbuf_addch(&buf, '\\n');\n \t}\n@@ -1239,6 +1231,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\tfclose(stdout);\n \t}\n \tfree(list);\n+\tstring_list_clear(&extra_to, 0);\n+\tstring_list_clear(&extra_cc, 0);\n+\tstring_list_clear(&extra_hdr, 0);\n \tif (ignore_if_in_upstream)\n \t\tfree_patch_ids(&ids);\n \treturn 0;\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136367","messageId":"1268002008-13426-3-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 2/3] format-patch: add --no-cc, --no-to, and --no-add-headers","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T22:46:47Z","receivedAt":"2010-03-07T22:46:47Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"These new options allow users to override their config settings for\nformat.cc, format.to and format.headers respectively. These options\nonly make git ignore the config settings and any previous command line\noptions, so you'll still have to add more command line options to add\nextra headers. For example,\n\n\t$ cat .git/config\n\t[format]\n\t\tto = Someone <someone@out.there>\n\t$ git format-patch -1 --no-to --to=\"Someone Else <else@out.there>\"\n\nwould format a patch addressed to \"Someone Else\" and not \"Someone\".\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n builtin-log.c           |   25 ++++++++++++++++++-------\n t/t4014-format-patch.sh |   38 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 56 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex ca241af..08e2ff0 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -869,19 +869,31 @@ static int inline_callback(const struct option *opt, const char *arg, int unset)\n \n static int header_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tadd_header(arg);\n+\tif (unset) {\n+\t\tstring_list_clear(&extra_hdr, 0);\n+\t\tstring_list_clear(&extra_to, 0);\n+\t\tstring_list_clear(&extra_cc, 0);\n+\t} else {\n+\t    add_header(arg);\n+\t}\n \treturn 0;\n }\n \n static int to_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tstring_list_append(arg, &extra_to);\n+\tif (unset)\n+\t\tstring_list_clear(&extra_to, 0);\n+\telse\n+\t\tstring_list_append(arg, &extra_to);\n \treturn 0;\n }\n \n static int cc_callback(const struct option *opt, const char *arg, int unset)\n {\n-\tstring_list_append(arg, &extra_cc);\n+\tif (unset)\n+\t\tstring_list_clear(&extra_cc, 0);\n+\telse\n+\t\tstring_list_append(arg, &extra_cc);\n \treturn 0;\n }\n \n@@ -940,12 +952,11 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t  PARSE_OPT_NONEG | PARSE_OPT_NOARG },\n \t\tOPT_GROUP(\"Messaging\"),\n \t\t{ OPTION_CALLBACK, 0, \"add-header\", NULL, \"header\",\n-\t\t\t    \"add email header\", PARSE_OPT_NONEG,\n-\t\t\t    header_callback },\n+\t\t\t    \"add email header\", 0, header_callback },\n \t\t{ OPTION_CALLBACK, 0, \"to\", NULL, \"email\", \"add To: header\",\n-\t\t\t    PARSE_OPT_NONEG, to_callback },\n+\t\t\t    0, to_callback },\n \t\t{ OPTION_CALLBACK, 0, \"cc\", NULL, \"email\", \"add Cc: header\",\n-\t\t\t    PARSE_OPT_NONEG, cc_callback },\n+\t\t\t    0, cc_callback },\n \t\tOPT_STRING(0, \"in-reply-to\", &in_reply_to, \"message-id\",\n \t\t\t    \"make first mail a reply to <message-id>\"),\n \t\t{ OPTION_CALLBACK, 0, \"attach\", &rev, \"boundary\",\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 830ddb0..c7b6256 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -157,6 +157,44 @@ test_expect_success 'configuration To: header' '\n \tgrep \"^To: R. E. Cipient <rcipient@example.com>\\$\" patch9\n '\n \n+test_expect_success '--no-to overrides config.to' '\n+\n+\tgit config --replace-all format.to \\\n+\t\t\"R. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-to --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch10 &&\n+\t! grep \"^To: R. E. Cipient <rcipient@example.com>\\$\" patch10\n+'\n+\n+test_expect_success '--no-to and --to replaces config.to' '\n+\n+\tgit config --replace-all format.to \\\n+\t\t\"Someone <someone@out.there>\" &&\n+\tgit format-patch --no-to --to=\"Someone Else <else@out.there>\" \\\n+\t\t--stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch11 &&\n+\t! grep \"^To: Someone <someone@out.there>\\$\" patch11 &&\n+\tgrep \"^To: Someone Else <else@out.there>\\$\" patch11\n+'\n+\n+test_expect_success '--no-cc overrides config.cc' '\n+\n+\tgit config --replace-all format.cc \\\n+\t\t\"C. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-cc --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch12 &&\n+\t! grep \"^Cc: C. E. Cipient <rcipient@example.com>\\$\" patch12\n+'\n+\n+test_expect_success '--no-add-headers overrides config.headers' '\n+\n+\tgit config --replace-all format.headers \\\n+\t\t\"Header1: B. E. Cipient <rcipient@example.com>\" &&\n+\tgit format-patch --no-add-headers --stdout master..side |\n+\tsed -e \"/^\\$/q\" >patch13 &&\n+\t! grep \"^Header1: B. E. Cipient <rcipient@example.com>\\$\" patch13\n+'\n+\n test_expect_success 'multiple files' '\n \n \trm -rf patches/ &&\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136368","messageId":"1268002008-13426-4-git-send-email-bebarino@gmail.com","threadId":"22899","inReplyTo":"1267997598-20815-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 3/3] send-email: add --no-cc, --no-to, and --no-bcc","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-03-07T22:46:48Z","receivedAt":"2010-03-07T22:46:48Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"There's no way to override the sendemail.to, sendemail.cc, and\nsendemail.bcc config settings. Add options allowing the user to tell\ngit to ignore the config settings and take whatever is on the command\nline.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-send-email.perl   |   14 +++++++---\n t/t9001-send-email.sh |   66 +++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 76 insertions(+), 4 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex e05455f..d612ae8 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -47,9 +47,9 @@ git send-email [options] <file | directory | rev-list options >\n \n   Composing:\n     --from                  <str>  * Email From:\n-    --to                    <str>  * Email To:\n-    --cc                    <str>  * Email Cc:\n-    --bcc                   <str>  * Email Bcc:\n+    --[no-]to               <str>  * Email To:\n+    --[no-]cc               <str>  * Email Cc:\n+    --[no-]bcc              <str>  * Email Bcc:\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n     --annotate                     * Review each patch that will be sent in an editor.\n@@ -135,7 +135,7 @@ sub unique_email_list(@);\n sub cleanup_compose_files();\n \n # Variables we fill in automatically, or via prompting:\n-my (@to,@cc,@initial_cc,@bcclist,@xh,\n+my (@to,$no_to,@cc,$no_cc,@initial_cc,@bcclist,$no_bcc,@xh,\n \t$initial_reply_to,$initial_subject,@files,\n \t$author,$sender,$smtp_authpass,$annotate,$compose,$time);\n \n@@ -261,8 +261,11 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n                     \"in-reply-to=s\" => \\$initial_reply_to,\n \t\t    \"subject=s\" => \\$initial_subject,\n \t\t    \"to=s\" => \\@to,\n+\t\t    \"no-to\" => \\$no_to,\n \t\t    \"cc=s\" => \\@initial_cc,\n+\t\t    \"no-cc\" => \\$no_cc,\n \t\t    \"bcc=s\" => \\@bcclist,\n+\t\t    \"no-bcc\" => \\$no_bcc,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n@@ -305,6 +308,9 @@ sub read_config {\n \n \tforeach my $setting (keys %config_settings) {\n \t\tmy $target = $config_settings{$setting};\n+\t\tnext if $setting eq \"to\" and defined $no_to;\n+\t\tnext if $setting eq \"cc\" and defined $no_cc;\n+\t\tnext if $setting eq \"bcc\" and defined $no_bcc;\n \t\tif (ref($target) eq \"ARRAY\") {\n \t\t\tunless (@$target) {\n \t\t\t\tmy @values = Git::config(@repo, \"$prefix.$setting\");\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex c09f375..640b3d2 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -852,4 +852,70 @@ test_expect_success 'no warning with sendemail.chainreplyto = true' '\n \t! grep \"no-chain-reply-to\" errors\n '\n \n+test_expect_success 'sendemail.to works' '\n+\tgit config --replace-all sendemail.to \"Somebody <somebody@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"To: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success '--no-to overrides sendemail.to' '\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-to \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"To: nobody@example.com\" stdout &&\n+\t! grep \"To: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success 'sendemail.cc works' '\n+\tgit config --replace-all sendemail.cc \"Somebody <somebody@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"Cc: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success '--no-cc overrides sendemail.cc' '\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-cc \\\n+\t\t--cc=bodies@example.com \\\n+\t\t--to=nobody@example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"Cc: bodies@example.com\" stdout &&\n+\t! grep \"Cc: Somebody <somebody@ex.com>\" stdout\n+'\n+\n+test_expect_success 'sendemail.bcc works' '\n+\tgit config --replace-all sendemail.bcc \"Other <other@ex.com>\" &&\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--to=nobody@example.com \\\n+\t\t--smtp-server relay.example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"RCPT TO:<other@ex.com>\" stdout\n+'\n+\n+test_expect_success '--no-bcc overrides sendemail.bcc' '\n+\tgit send-email \\\n+\t\t--dry-run \\\n+\t\t--from=\"Example <nobody@example.com>\" \\\n+\t\t--no-bcc \\\n+\t\t--bcc=bodies@example.com \\\n+\t\t--to=nobody@example.com \\\n+\t\t--smtp-server relay.example.com \\\n+\t\t$patches $patches >stdout &&\n+\tgrep \"RCPT TO:<bodies@example.com>\" stdout &&\n+\t! grep \"RCPT TO:<other@ex.com>\" stdout\n+'\n+\n test_done\n-- \n1.7.0.1.171.geb5ee\n"},{"id":"136419","messageId":"7vy6i29pu7.fsf@alter.siamese.dyndns.org","threadId":"22899","inReplyTo":"1267997598-20815-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH 0/4] format-patch and send-email ignoring config settings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-09T02:44:00Z","receivedAt":"2010-03-09T02:44:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; will queue.\n"},{"id":"136487","messageId":"alpine.LNX.2.00.1003101643390.21063@vqena.qenxr.bet.am","threadId":"22899","inReplyTo":"7vk4torn8j.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add tests for git format-patch --to and format.to config option","fromName":"Steven Drake","fromEmail":"sdrake@xnet.co.nz","sentAt":"2010-03-10T03:53:57Z","receivedAt":"2010-03-10T03:53:57Z","isPatch":true,"sender":{"key":"sdrake@xnet.co.nz","avatar":null},"body":"On Sun, 7 Mar 2010, Junio C Hamano wrote:\n> Stephen Boyd <bebarino@gmail.com> writes:\n> \n> > ... We have the\n> > option of making them consistent with the rest of git with a little bit\n> > of work. If you say --no-cc or --no-add-headers or --no-to the\n> > respective config should be overriden. If you say --to or --cc or\n> > --add-headers it should be appended. I doubt anyone would find that\n> > surprising since --no-* doesn't do anything right now.\n> \n> That sounds like a sensible and practical way out, as it won't break\n> existing setup that expects the additive behaviour these two command\n> somehow ended up with, while allowing --no-* to override the config when\n> necessary.\n\nI agree with that.\n\n-- \nSteven\n"}]}