{"thread":{"id":"30799","subject":"What's cooking in git.git (Jun 2012, #03; Wed, 13)","startedAt":"2012-06-13T23:01:55Z","lastAt":"2012-06-14T17:13:54Z","messageCount":8,"participants":["Junio C Hamano","Matthieu Moy","y@imag.fr"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193604","messageId":"7vk3zag6jg.fsf@alter.siamese.dyndns.org","threadId":"30799","inReplyTo":null,"subject":"What's cooking in git.git (Jun 2012, #03; Wed, 13)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-13T23:01:55Z","receivedAt":"2012-06-13T23:01:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Here are the topics that have been cooking.  Commits prefixed with '-' are\nonly in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'.\n\nMost likely, I'll tag 1.7.11 final this weekend.  It doesn't look\nlike there is any remaining topic that cannot wait for the next\ncycle.  A few small regressions on the master front have been\npatched up, and it seems we are good to go.\n\nYou can find the changes described here in the integration branches of the\nrepositories listed at\n\n    http://git-blame.blogspot.com/p/git-public-repositories.html\n\n--------------------------------------------------\n[New Topics]\n\n* nd/i18n-branch-lego (2012-06-07) 1 commit\n - Remove i18n legos in notifying new branch tracking setup\n\nRestructure the way message strings are created, in preparation for\nmarking them for i18n.\n\n* nd/i18n-misc (2012-06-07) 3 commits\n - rerere: remove i18n legos in result message\n - notes-merge: remove i18n legos in merge result message\n - reflog: remove i18n legos in pruning message\n\nRestructure the way message strings are created, in preparation for\nmarking them for i18n.\n\n* rr/doc-commit (2012-06-08) 1 commit\n - commit: document a couple of options\n\n* hv/remote-end-hung-up (2012-06-11) 1 commit\n - lessen the impression of unexpectedness on remote hangup\n\n* hv/submodule-checkout-nuke-submodules (2012-06-11) 1 commit\n - update-index: allow overwriting existing submodule index entries\n\n* jc/rev-list-simplify-merges-first-parent (2012-06-13) 3 commits\n - revision: ignore side parents while running simplify-merges\n - revision: note the lack of free() in simplify_merges()\n - revision: \"simplify\" options imply topo-order sort\n\n* jc/ustar-checksum-is-unsigned (2012-06-13) 1 commit\n - archive: ustar header checksum is computed unsigned\n\n* rs/git-blame-mapcar-mapc (2012-06-10) 1 commit\n - git-blame.el: use mapc instead of mapcar\n\n* rs/ipv6-ssh-url (2012-06-13) 1 commit\n - git: Wrong parsing of ssh urls with IPv6 literals ignores port\n\n* vr/use-our-perl-in-tests (2012-06-12) 3 commits\n - t/README: add a bit more Don'ts\n - tests: enclose $PERL_PATH in duoble quotes\n - t: Replace 'perl' by $PERL_PATH\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* cr/persistent-https (2012-05-30) 1 commit\n  (merged to 'next' on 2012-06-01 at c647464)\n + Add persistent-https to contrib\n\nA remote helper that acts as a proxy that caches ssl session for the\nhttps:// transport is added to the contrib/ area.\n\n* jc/fmt-merge-msg-people (2012-06-06) 1 commit\n  (merged to 'next' on 2012-06-08 at 7d8f4b6)\n + fmt-merge-msg: make attribution into comment lines\n\n* jc/svn-auth-providers-unusable-at-1.6.12 (2012-06-04) 1 commit\n  (merged to 'next' on 2012-06-04 at c4ffe24)\n + git-svn: platform auth providers are working only on 1.6.15 or newer\n\nRegression fix for people with libsvn between 1.6.12 and 1.6.15 on\nwhich we tried to use non-working platform auth providers.\n\n* mm/api-credentials-doc (2012-06-07) 5 commits\n + docs: fix cross-directory linkgit references\n  (merged to 'next' on 2012-06-05 at 8e14814)\n + api-credentials.txt: add \"see also\" section\n + api-credentials.txt: mention credential.helper explicitly\n + api-credentials.txt: show the big picture first\n + doc: fix xref link from api docs to manual pages\n\n* rr/maint-t3510-cascade-fix (2012-06-04) 1 commit\n  (merged to 'next' on 2012-06-04 at 4c3368b)\n + t3510 (cherry-pick-sequence): add missing '&&'\n\n--------------------------------------------------\n[Stalled]\n\n* nl/http-proxy-more (2012-05-11) 2 commits\n - http: rename HTTP_REAUTH to HTTP_AUTH_RETRY\n - http: Avoid limit of retrying request only twice\n\nI queued only the later two patches from this series, even though they do\nnot make much sense without the first one that seems to need a bit more\nwork, so that we won't forget.\n\n* jk/no-op-push-message (2012-05-30) 1 commit\n - improve no-op push output\n\nRewords the status message of \"git push\" that pushed only one ref\ndifferently from \"Everything up-to-date\", to give a bit more help to\npeople who get the message when their current branch is not pushed.\n\nI had an impression after the discussion thread that a redesign is\ncoming, but it hasn't happened yet.\n\n* fc/git-prompt-script (2012-06-10) 6 commits\n - completion: warn people about duplicated function\n - completion: split __git_ps1 into a separate script\n - completion: remove executable mode\n - Merge branch 'fc/git-complete-helper' into fc/git-prompt-script\n - tests: add tests for the bash prompt functions in the completion script\n - tests: move code to run tests under bash into a helper library\n (this branch is tangled with sg/bash-prompt.)\n\nThe last remaining sticking point is what to do with the duplicated\nshell function.  Together with the warning patch at the tip, if we\nside port the tip commit from sg/bash-prompt, I think this will be\nready for testing.\n\n* sg/bash-prompt (2012-05-09) 4 commits\n - completion: respect $GIT_DIR\n - completion: use __gitdir() in _git_log()\n - tests: add tests for the bash prompt functions in the completion script\n - tests: move code to run tests under bash into a helper library\n (this branch is tangled with fc/git-prompt-script.)\n\nThis is only the \"correction\" bits taken from the beginning of a larger\nseries that is to be rerolled.  The first two are tangled with Felipe's\ntopic so a reroll, if comes, should build on top of them.\n\n* jc/maint-push-refs-all (2012-05-04) 2 commits\n - get_fetch_map(): tighten checks on dest refs\n - fetch/push: allow refs/*:refs/*\n\nAllows pushing and fetching refs/stash.\nThere still seem to be other bugs hiding (e.g. try pushing twice).\n\nNot ready.\n\n* jc/run-hook-env-1 (2012-03-11) 1 commit\n - run_hook(): enhance the interface to pass arbitrary environment\n\nNot urgent.\n\nUpdates run_hook() API to be much less specific to \"commit\".  It would\nonly be useful if people start doing more interesting things with hooks.\n\n* jc/split-blob (2012-04-03) 6 commits\n - chunked-object: streaming checkout\n - chunked-object: fallback checkout codepaths\n - bulk-checkin: support chunked-object encoding\n - bulk-checkin: allow the same data to be multiply hashed\n - new representation types in the packstream\n - packfile: use varint functions\n\nNot ready.\n\nI finished the streaming checkout codepath, but as explained in\n127b177 (bulk-checkin: support chunked-object encoding, 2011-11-30),\nthese are still early steps of a long and painful journey. At least\npack-objects and fsck need to learn the new encoding for the series\nto be usable locally, and then index-pack/unpack-objects needs to\nlearn it to be used remotely.\n\nGiven that I heard a lot of noise that people want large files, and\nthat I was asked by somebody at GitTogether'11 privately for an\nadvice on how to pay developers (not me) to help adding necessary\nsupport, I am somewhat dissapointed that the original patch series\nthat was sent almost two months ago still remains here without much\ncomments and updates from the developer community. I even made the\ninterface to the logic that decides where to split chunks easily\nreplaceable, and I deliberately made the logic in the original patch\nextremely stupid to entice others, especially the \"bup\" fanboys, to\ncome up with a better logic, thinking that giving people an easy\ntarget to shoot for, they may be encouraged to help out. The plan is\nnot working :-(.\n\n--------------------------------------------------\n[Cooking]\n\n* jc/apply-3way (2012-06-13) 19 commits\n - apply --3way: tests\n - apply: document --3way option\n - apply: allow rerere() upon --3way results\n - apply: register conflicted stages to the index\n - apply: --3way with add/add conflict\n - apply: move verify_index_match() higher\n - apply: plug the three-way merge logic in\n - apply: fall back on three-way merge\n - apply: accept -3/--3way command line option\n - apply: move \"already exists\" logic to check_to_create()\n - apply: move check_to_create_blob() closer to its sole caller\n - apply: further split load_preimage()\n - apply: refactor \"previous patch\" logic\n - apply: split load_preimage() helper function out\n - apply: factor out checkout_target() helper function\n - apply: refactor read_file_or_gitlink()\n - apply: clear_image() clears things a bit more\n - apply: a bit more comments on PATH_TO_BE_DELETED\n - apply: fix an incomplete comment in check_patch()\n\n\"git apply\" learns to wiggle the base version and perform three-way merge\nwhen a patch does not exactly apply to the version you have.\n\n\n* nd/exclude-workaround-top-heavy (2012-06-07) 3 commits\n - exclude: do strcmp as much as possible before fnmatch\n - dir.c: get rid of the wildcard symbol set in no_wildcard()\n - Unindent excluded_from_list()\n\nAttempts to optimize matching with an exclude pattern with a deep\ndirectory hierarchy by taking the part that specifies leading path\nwithout wildcard literally.\n\n* jc/bundle-complete-notice (2012-06-04) 1 commit\n  (merged to 'next' on 2012-06-05 at ee25a35)\n + tweak \"bundle verify\" of a complete history\n\nRunning \"git bundle verify\" on a bundle that records a complete\nhistory said \"it requires these 0 commits\".\n\nNot urgent; probably early post 1.7.11.\n\n* lk/more-helpful-status-hints (2012-06-11) 5 commits\n - fixup! status: better advices when splitting a commit (during rebase -i)\n - status: better advices when splitting a commit (during rebase -i)\n - status: don't suggest \"git rm\" or \"git add\" if not appropriate\n - t7512-status-help.sh: better advices for git status\n - wt-status.*: better advices for git status added\n\nAlmost there, modulo minor details pointed out by Matthieu.\n\n* jk/no-more-pre-exec-callback (2012-06-05) 1 commit\n - pager: drop \"wait for output to run less\" hack\n\nOn hold for 6 months until ancient \"less\" goes extinct.\n\n* jk/maint-t1304-setfacl (2012-06-07) 1 commit\n  (merged to 'next' on 2012-06-08 at ebba27c)\n + t1304: improve setfacl prerequisite setup\n\nWorks around a false test failure caused by a bug in ecryptofs.\n\nNot urgent; probably early post 1.7.11.\n\n* lk/rebase-i-x (2012-06-13) 1 commit\n - rebase -i: teach \"--exec <cmd>\"\n\nAdds -x <cmd> to \"rebase -i\" to insert \"exec <cmd>\" after each\ncommit in the resulting history.\n\nWill merge to next after 1.7.11.\n\n* vr/help-per-platform (2012-06-06) 1 commit\n  (merged to 'next' on 2012-06-08 at f4b2b0b)\n + help: use HTML as the default help format on Windows\n\nNot urgent; probably early post 1.7.11.\n\n* jc/ls-files-i-dir (2012-06-05) 6 commits\n  (merged to 'next' on 2012-06-08 at 2b5a256)\n + dir.c: make excluded() file scope static\n + unpack-trees.c: use path_excluded() in check_ok_to_remove()\n + builtin/add.c: use path_excluded()\n + path_excluded(): update API to less cache-entry centric\n  (merged to 'next' on 2012-06-05 at 8f35db3)\n + ls-files -i: micro-optimize path_excluded()\n + ls-files -i: pay attention to exclusion of leading paths\n\n\"git ls-files --exclude=t -i\" did not consider anything under t/\nas excluded, as it did not pay attention to exclusion of leading\npaths while walking the index.  Other two users of excluded() are\nalso updated.\n\nNot urgent; probably early post 1.7.11.\n\n* jc/request-pull-match-tagname (2012-06-01) 1 commit\n  (merged to 'next' on 2012-06-05 at f0dc420)\n + request-pull: really favor a matching tag\n\n\"git request-pull $url dev\" when the tip of \"dev\" branch was tagged\nwith \"ext4-for-linus\" used the contents from the tag in the output\nbut still asked the \"dev\" branch to be pulled, not the tag.\n\nNot urgent; probably early post 1.7.11.\n\n* db/vcs-svn (2012-06-01) 6 commits\n - vcs-svn: drop no-op reset methods\n - vcs-svn: fix signedness warnings\n - vcs-svn: prefer strstr over memmem\n - vcs-svn: prefer constcmp to prefixcmp\n - vcs-svn: simplify cleanup in apply_one_window()\n - vcs-svn: fix clang-analyzer error\n\nI'd take Jonathan's clean-up offer and keep this on hold until\n1.7.11 final.\n\n* jk/version-string (2012-06-03) 3 commits\n  (merged to 'next' on 2012-06-05 at b6f7266)\n + http: get default user-agent from git_user_agent\n + version: add git_user_agent function\n + move git_version_string into version.c\n\nWill merge to master early post 1.7.11.\n\n* nd/stream-pack-objects (2012-05-29) 1 commit\n - pack-objects: use streaming interface for reading large loose blobs\n\nWill merge to next after 1.7.11.\n\n* jk/clone-local (2012-05-30) 2 commits\n  (merged to 'next' on 2012-06-05 at b819eb5)\n + clone: allow --no-local to turn off local optimizations\n + docs/clone: mention that --local may be ignored\n\n\"git clone --local $path\" started its life as an experiment to\noptionally use link/copy when cloning a repository on the disk, but\nwe didn't deprecate it after we made the option a no-op to always\nuse the optimization.\n\nNot urgent; probably early post 1.7.11.\n\n* jk/no-more-asciidoc7 (2012-05-30) 2 commits\n  (merged to 'next' on 2012-06-05 at 3f117df)\n + docs: drop antique comment from Makefile\n + docs: drop asciidoc7compatible flag\n\nNot urgent; probably early post 1.7.11.\n\n* nd/stream-index-pack (2012-05-24) 4 commits\n - index-pack: use streaming interface for collision test on large blobs\n - index-pack: factor out unpack core from get_data_from_pack\n - index-pack: use streaming interface on large blobs (most of the time)\n - index-pack: hash non-delta objects while reading from stream\n\nUse streaming API to read from the object store to avoid having to hold\na large blob object in-core while running index-pack.\n\nWill merge to next after 1.7.11.\n\n* js/submodule-relative (2012-06-06) 4 commits\n - submodule: fix handling of superproject origin URLs like foo, ./foo and ./foo/bar\n - submodule: fix sync handling of some relative superproject origin URLs\n - submodule: document failure to handle relative superproject origin URLs\n - submodule: additional regression tests for relative URLs\n\nMakes \"git submodule\" deal with nested submodule structure where a\nmodule is contained within a module whose origin is specified as a\nrelative URL to its superproject's origin.\n\nNot urgent; probably early post 1.7.11.\n\n* mm/push-default-switch-warning (2012-06-06) 1 commit\n - push: start warning upcoming default change for push.default\n\nWill merge to next after 1.7.11.\n\nHopwefully we can have a solidly tested series early in 1.7.12 or\n1.7.13 at the latest.\n\n--------------------------------------------------\n[Discarded]\n\n* cb/daemon-test-race-fix (2012-04-27) 2 commits\n  (merged to 'next' on 2012-04-27 at 84bbcf8)\n + Revert \"git-daemon wrapper to wait until daemon is ready\"\n  (merged to 'next' on 2012-04-24 at d5c30be)\n + git-daemon wrapper to wait until daemon is ready\n\nReverted from 'next' to replace it with js/daemon-test-race-fix.\n\n* jc/merge-annotated-tag (2012-06-05) 2 commits\n . merge: allow fast-forwarding to an annotated but unsigned tag\n . merge: separte the logic to check for a signed tag\n\n\"git merge anno\" created a merge commit even when anno is an\nunsigned annotated tag that points at a commit that can be fast\nforwarded to; this came from a laziness of the implementation of\nmerging of signed tags in 1.7.9.  People may have different opinion\non making signed and unsigned annotated tag behave differently, but\nI tend to agree that it is probably not a good idea.\n"},{"id":"193623","messageId":"vpq7gvacnnl.fsf@bauges.imag.fr","threadId":"30799","inReplyTo":"7vk3zag6jg.fsf@alter.siamese.dyndns.org","subject":"lk/more-helpful-status-hints (was Re: What's cooking in git.git (Jun 2012, #03; Wed, 13))","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-06-14T08:18:06Z","receivedAt":"2012-06-14T08:18:06Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> * lk/more-helpful-status-hints (2012-06-11) 5 commits\n>  - fixup! status: better advices when splitting a commit (during rebase -i)\n>  - status: better advices when splitting a commit (during rebase -i)\n>  - status: don't suggest \"git rm\" or \"git add\" if not appropriate\n>  - t7512-status-help.sh: better advices for git status\n>  - wt-status.*: better advices for git status added\n>\n> Almost there, modulo minor details pointed out by Matthieu.\n\nThe details I pointed out earlier are already fixed. I went through the\nserie again, and suggest two more minor fixups:\n\nfixup! reword message when splitting a commit.\nfixup! don't allocate struct wt_status_state dynamically\n\npatches follow.\n\n> * lk/rebase-i-x (2012-06-13) 1 commit\n>  - rebase -i: teach \"--exec <cmd>\"\n>\n> Adds -x <cmd> to \"rebase -i\" to insert \"exec <cmd>\" after each\n> commit in the resulting history.\n>\n> Will merge to next after 1.7.11.\n\nCool!\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"193625","messageId":"20099.6449254037$1339662032@news.gmane.org","threadId":"30799","inReplyTo":"7vk3zag6jg.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically","fromName":"","fromEmail":"y@imag.fr","sentAt":"2012-06-14T08:20:13Z","receivedAt":"2012-06-14T08:20:13Z","isPatch":true,"sender":{"key":"y@imag.fr","avatar":null},"body":"From: Matthieu Moy <Matthieu.Moy@imag.fr>\n\nThe common\n\nvoid function() {\n\tstruct wt_status_state *state = calloc(...);\n\t...\n\tfree(state);\n}\n\nis essentially a less efficient, and more error prone way of allocating a\nvariable on the stack (plus, the calloc should have been a xcalloc).\nReplace it with an on-stack variable.\n\nWhile we're there, also replace the individual initializations of fields\nwith memset(..., 0, ...).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n\n(BTW, I didn't find a way to have both --autosquash-compliant and\nmeaningfull titles)\n\n wt-status.c | 49 +++++++++++++++++++++----------------------------\n 1 file changed, 21 insertions(+), 28 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex ed28b4f..e65716d 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -932,49 +932,42 @@ static void show_bisect_in_progress(struct wt_status *s,\n static void wt_status_print_state(struct wt_status *s)\n {\n \tconst char *state_color = color(WT_STATUS_IN_PROGRESS, s);\n-\tstruct wt_status_state *state = calloc(1, sizeof(*state));\n+\tstruct wt_status_state state;\n \tstruct stat st;\n \n-\tstate->merge_in_progress = 0;\n-\tstate->am_in_progress = 0;\n-\tstate->am_empty_patch = 0;\n-\tstate->rebase_in_progress = 0;\n-\tstate->rebase_interactive_in_progress = 0;\n-\tstate->cherry_pick_in_progress = 0;\n-\tstate->bisect_in_progress = 0;\n+\tmemset(&state, 0, sizeof(state));\n \n \tif (!stat(git_path(\"MERGE_HEAD\"), &st)) {\n-\t\tstate->merge_in_progress = 1;\n+\t\tstate.merge_in_progress = 1;\n \t} else if (!stat(git_path(\"rebase-apply\"), &st)) {\n \t\tif (!stat(git_path(\"rebase-apply/applying\"), &st)) {\n-\t\t\tstate->am_in_progress = 1;\n+\t\t\tstate.am_in_progress = 1;\n \t\t\tif (!stat(git_path(\"rebase-apply/patch\"), &st) && !st.st_size)\n-\t\t\t\tstate->am_empty_patch = 1;\n+\t\t\t\tstate.am_empty_patch = 1;\n \t\t} else {\n-\t\t\tstate->rebase_in_progress = 1;\n+\t\t\tstate.rebase_in_progress = 1;\n \t\t}\n \t} else if (!stat(git_path(\"rebase-merge\"), &st)) {\n \t\tif (!stat(git_path(\"rebase-merge/interactive\"), &st))\n-\t\t\tstate->rebase_interactive_in_progress = 1;\n+\t\t\tstate.rebase_interactive_in_progress = 1;\n \t\telse\n-\t\t\tstate->rebase_in_progress = 1;\n+\t\t\tstate.rebase_in_progress = 1;\n \t} else if (!stat(git_path(\"CHERRY_PICK_HEAD\"), &st)) {\n-\t\tstate->cherry_pick_in_progress = 1;\n+\t\tstate.cherry_pick_in_progress = 1;\n \t}\n \tif (!stat(git_path(\"BISECT_LOG\"), &st))\n-\t\tstate->bisect_in_progress = 1;\n-\n-\tif (state->merge_in_progress)\n-\t\tshow_merge_in_progress(s, state, state_color);\n-\telse if (state->am_in_progress)\n-\t\tshow_am_in_progress(s, state, state_color);\n-\telse if (state->rebase_in_progress || state->rebase_interactive_in_progress)\n-\t\tshow_rebase_in_progress(s, state, state_color);\n-\telse if (state->cherry_pick_in_progress)\n-\t\tshow_cherry_pick_in_progress(s, state, state_color);\n-\tif (state->bisect_in_progress)\n-\t\tshow_bisect_in_progress(s, state, state_color);\n-\tfree(state);\n+\t\tstate.bisect_in_progress = 1;\n+\n+\tif (state.merge_in_progress)\n+\t\tshow_merge_in_progress(s, &state, state_color);\n+\telse if (state.am_in_progress)\n+\t\tshow_am_in_progress(s, &state, state_color);\n+\telse if (state.rebase_in_progress || state.rebase_interactive_in_progress)\n+\t\tshow_rebase_in_progress(s, &state, state_color);\n+\telse if (state.cherry_pick_in_progress)\n+\t\tshow_cherry_pick_in_progress(s, &state, state_color);\n+\tif (state.bisect_in_progress)\n+\t\tshow_bisect_in_progress(s, &state, state_color);\n }\n \n void wt_status_print(struct wt_status *s)\n-- \n1.7.11.rc0.57.g84a04c7\n"},{"id":"299220","messageId":"1339662014-30173-1-git-send-email-y","threadId":"30799","inReplyTo":"7vk3zag6jg.fsf@alter.siamese.dyndns.org","subject":"[PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically","fromName":"","fromEmail":"y@imag.fr","sentAt":"2012-06-14T08:20:13Z","receivedAt":"2012-06-14T08:20:13Z","isPatch":true,"sender":{"key":"y@imag.fr","avatar":null},"body":"From: Matthieu Moy <Matthieu.Moy@imag.fr>\n\nThe common\n\nvoid function() {\n\tstruct wt_status_state *state = calloc(...);\n\t...\n\tfree(state);\n}\n\nis essentially a less efficient, and more error prone way of allocating a\nvariable on the stack (plus, the calloc should have been a xcalloc).\nReplace it with an on-stack variable.\n\nWhile we're there, also replace the individual initializations of fields\nwith memset(..., 0, ...).\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n\n(BTW, I didn't find a way to have both --autosquash-compliant and\nmeaningfull titles)\n\n wt-status.c | 49 +++++++++++++++++++++----------------------------\n 1 file changed, 21 insertions(+), 28 deletions(-)\n\ndiff --git a/wt-status.c b/wt-status.c\nindex ed28b4f..e65716d 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -932,49 +932,42 @@ static void show_bisect_in_progress(struct wt_status *s,\n static void wt_status_print_state(struct wt_status *s)\n {\n \tconst char *state_color = color(WT_STATUS_IN_PROGRESS, s);\n-\tstruct wt_status_state *state = calloc(1, sizeof(*state));\n+\tstruct wt_status_state state;\n \tstruct stat st;\n \n-\tstate->merge_in_progress = 0;\n-\tstate->am_in_progress = 0;\n-\tstate->am_empty_patch = 0;\n-\tstate->rebase_in_progress = 0;\n-\tstate->rebase_interactive_in_progress = 0;\n-\tstate->cherry_pick_in_progress = 0;\n-\tstate->bisect_in_progress = 0;\n+\tmemset(&state, 0, sizeof(state));\n \n \tif (!stat(git_path(\"MERGE_HEAD\"), &st)) {\n-\t\tstate->merge_in_progress = 1;\n+\t\tstate.merge_in_progress = 1;\n \t} else if (!stat(git_path(\"rebase-apply\"), &st)) {\n \t\tif (!stat(git_path(\"rebase-apply/applying\"), &st)) {\n-\t\t\tstate->am_in_progress = 1;\n+\t\t\tstate.am_in_progress = 1;\n \t\t\tif (!stat(git_path(\"rebase-apply/patch\"), &st) && !st.st_size)\n-\t\t\t\tstate->am_empty_patch = 1;\n+\t\t\t\tstate.am_empty_patch = 1;\n \t\t} else {\n-\t\t\tstate->rebase_in_progress = 1;\n+\t\t\tstate.rebase_in_progress = 1;\n \t\t}\n \t} else if (!stat(git_path(\"rebase-merge\"), &st)) {\n \t\tif (!stat(git_path(\"rebase-merge/interactive\"), &st))\n-\t\t\tstate->rebase_interactive_in_progress = 1;\n+\t\t\tstate.rebase_interactive_in_progress = 1;\n \t\telse\n-\t\t\tstate->rebase_in_progress = 1;\n+\t\t\tstate.rebase_in_progress = 1;\n \t} else if (!stat(git_path(\"CHERRY_PICK_HEAD\"), &st)) {\n-\t\tstate->cherry_pick_in_progress = 1;\n+\t\tstate.cherry_pick_in_progress = 1;\n \t}\n \tif (!stat(git_path(\"BISECT_LOG\"), &st))\n-\t\tstate->bisect_in_progress = 1;\n-\n-\tif (state->merge_in_progress)\n-\t\tshow_merge_in_progress(s, state, state_color);\n-\telse if (state->am_in_progress)\n-\t\tshow_am_in_progress(s, state, state_color);\n-\telse if (state->rebase_in_progress || state->rebase_interactive_in_progress)\n-\t\tshow_rebase_in_progress(s, state, state_color);\n-\telse if (state->cherry_pick_in_progress)\n-\t\tshow_cherry_pick_in_progress(s, state, state_color);\n-\tif (state->bisect_in_progress)\n-\t\tshow_bisect_in_progress(s, state, state_color);\n-\tfree(state);\n+\t\tstate.bisect_in_progress = 1;\n+\n+\tif (state.merge_in_progress)\n+\t\tshow_merge_in_progress(s, &state, state_color);\n+\telse if (state.am_in_progress)\n+\t\tshow_am_in_progress(s, &state, state_color);\n+\telse if (state.rebase_in_progress || state.rebase_interactive_in_progress)\n+\t\tshow_rebase_in_progress(s, &state, state_color);\n+\telse if (state.cherry_pick_in_progress)\n+\t\tshow_cherry_pick_in_progress(s, &state, state_color);\n+\tif (state.bisect_in_progress)\n+\t\tshow_bisect_in_progress(s, &state, state_color);\n }\n \n void wt_status_print(struct wt_status *s)\n-- \n1.7.11.rc0.57.g84a04c7\n\n"},{"id":"193624","messageId":"43585.3446987041$1339662031@news.gmane.org","threadId":"30799","inReplyTo":"1339662014-30173-1-git-send-email-y","subject":"[PATCH 2/2] fixup! 38388c8 reword message when splitting a commit.","fromName":"","fromEmail":"y@imag.fr","sentAt":"2012-06-14T08:20:14Z","receivedAt":"2012-06-14T08:20:14Z","isPatch":true,"sender":{"key":"y@imag.fr","avatar":null},"body":"From: Matthieu Moy <Matthieu.Moy@imag.fr>\n\nThe \"splitting a commit\" is a sub-case of the \"rebase\" case, hence,\nmention rebase like this:\n\n  # You are currently splitting a commit during a rebase.\n\nThis makes the message consistant with \"editing a commit\":\n\n  # You are currently editing a commit during a rebase.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t7512-status-help.sh | 8 ++++----\n wt-status.c            | 2 +-\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh\nindex 3ce384a..b3f6eb9 100755\n--- a/t/t7512-status-help.sh\n+++ b/t/t7512-status-help.sh\n@@ -210,7 +210,7 @@ test_expect_success 'status when splitting a commit' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -290,7 +290,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -359,7 +359,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -433,7 +433,7 @@ test_expect_success 'status: (split first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\ndiff --git a/wt-status.c b/wt-status.c\nindex e65716d..c749267 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -886,7 +886,7 @@ static void show_rebase_in_progress(struct wt_status *s,\n \t\t\tstatus_printf_ln(s, color,\n \t\t\t\t_(\"  (all conflicts fixed: run \\\"git rebase --continue\\\")\"));\n \t} else if (split_commit_in_progress(s)) {\n-\t\tstatus_printf_ln(s, color, _(\"You are currently splitting a commit.\"));\n+\t\tstatus_printf_ln(s, color, _(\"You are currently splitting a commit during a rebase.\"));\n \t\tif (advice_status_hints)\n \t\t\tstatus_printf_ln(s, color,\n \t\t\t\t_(\"  (Once your working directory is clean, run \\\"git rebase --continue\\\")\"));\n-- \n1.7.11.rc0.57.g84a04c7\n"},{"id":"299188","messageId":"1339662014-30173-2-git-send-email-y","threadId":"30799","inReplyTo":"1339662014-30173-1-git-send-email-y","subject":"[PATCH 2/2] fixup! 38388c8 reword message when splitting a commit.","fromName":"","fromEmail":"y@imag.fr","sentAt":"2012-06-14T08:20:14Z","receivedAt":"2012-06-14T08:20:14Z","isPatch":true,"sender":{"key":"y@imag.fr","avatar":null},"body":"From: Matthieu Moy <Matthieu.Moy@imag.fr>\n\nThe \"splitting a commit\" is a sub-case of the \"rebase\" case, hence,\nmention rebase like this:\n\n  # You are currently splitting a commit during a rebase.\n\nThis makes the message consistant with \"editing a commit\":\n\n  # You are currently editing a commit during a rebase.\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n t/t7512-status-help.sh | 8 ++++----\n wt-status.c            | 2 +-\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh\nindex 3ce384a..b3f6eb9 100755\n--- a/t/t7512-status-help.sh\n+++ b/t/t7512-status-help.sh\n@@ -210,7 +210,7 @@ test_expect_success 'status when splitting a commit' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -290,7 +290,7 @@ test_expect_success 'status: (continue first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -359,7 +359,7 @@ test_expect_success 'status: (amend first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\n@@ -433,7 +433,7 @@ test_expect_success 'status: (split first edit) second edit and split' '\n \tgit reset HEAD^ &&\n \tcat >expected <<-\\EOF &&\n \t# Not currently on any branch.\n-\t# You are currently splitting a commit.\n+\t# You are currently splitting a commit during a rebase.\n \t#   (Once your working directory is clean, run \"git rebase --continue\")\n \t#\n \t# Changes not staged for commit:\ndiff --git a/wt-status.c b/wt-status.c\nindex e65716d..c749267 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -886,7 +886,7 @@ static void show_rebase_in_progress(struct wt_status *s,\n \t\t\tstatus_printf_ln(s, color,\n \t\t\t\t_(\"  (all conflicts fixed: run \\\"git rebase --continue\\\")\"));\n \t} else if (split_commit_in_progress(s)) {\n-\t\tstatus_printf_ln(s, color, _(\"You are currently splitting a commit.\"));\n+\t\tstatus_printf_ln(s, color, _(\"You are currently splitting a commit during a rebase.\"));\n \t\tif (advice_status_hints)\n \t\t\tstatus_printf_ln(s, color,\n \t\t\t\t_(\"  (Once your working directory is clean, run \\\"git rebase --continue\\\")\"));\n-- \n1.7.11.rc0.57.g84a04c7\n\n"},{"id":"193626","messageId":"vpq1ulicney.fsf@bauges.imag.fr","threadId":"30799","inReplyTo":"1339662014-30173-1-git-send-email-y","subject":"Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2012-06-14T08:23:17Z","receivedAt":"2012-06-14T08:23:17Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"> To: y@imag.fr\n\nOops, sorry, I tried answering \"yes\" to the wrong question. Obviously,\nthis is not my real email address :-(.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"193662","messageId":"7vy5nperzh.fsf@alter.siamese.dyndns.org","threadId":"30799","inReplyTo":"20099.6449254037$1339662032@news.gmane.org","subject":"Re: [PATCH 1/2] fixup! 8e00b48 don't allocate struct wt_status_state dynamically","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-14T17:13:54Z","receivedAt":"2012-06-14T17:13:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"y@imag.fr writes:\n\n> From: Matthieu Moy <Matthieu.Moy@imag.fr>\n>\n> The common\n>\n> void function() {\n> \tstruct wt_status_state *state = calloc(...);\n> \t...\n> \tfree(state);\n> }\n>\n> is essentially a less efficient, and more error prone way of allocating a\n> variable on the stack (plus, the calloc should have been a xcalloc).\n> Replace it with an on-stack variable.\n>\n> While we're there, also replace the individual initializations of fields\n> with memset(..., 0, ...).\n>\n> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n> ---\n>\n> (BTW, I didn't find a way to have both --autosquash-compliant and\n> meaningfull titles)\n>\n>  wt-status.c | 49 +++++++++++++++++++++----------------------------\n>  1 file changed, 21 insertions(+), 28 deletions(-)\n\nThanks; much better.\n"}]}