{"thread":{"id":"23298","subject":"What's cooking in git.git (Apr 2010, #01; Fri, 02)","startedAt":"2010-04-02T08:40:53Z","lastAt":"2010-04-04T21:42:48Z","messageCount":8,"participants":["Junio C Hamano","Nguyen Thai Ngoc Duy","Sverre Rabbelier","Nicolas Pitre","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"138411","messageId":"7vaatmckmi.fsf@alter.siamese.dyndns.org","threadId":"23298","inReplyTo":null,"subject":"What's cooking in git.git (Apr 2010, #01; Fri, 02)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-02T08:40:53Z","receivedAt":"2010-04-02T08:40:53Z","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\nTopics not in 'next' will have to wait until post 1.7.1 cycle.  I expect\nthat the changes already under discussion will be ready by the time the post\n1.7.1 cycle begins, and we will hopefully have a cycle for 1.7.2 that is\nshorter than usual to include them.\n\n--------------------------------------------------\n[Graduated to \"master\"]\n\n* sb/notes-parse-opt (2010-02-27) 1 commit\n  (merged to 'next' on 2010-03-24 at 82eebc1)\n + notes: rework subcommands and parse options\n\n* cc/cherry-pick-ff (2010-03-20) 7 commits\n  (merged to 'next' on 2010-03-20 at a1ae16b)\n + revert: fix tiny memory leak in cherry-pick --ff\n + rebase -i: use new --ff cherry-pick option\n  (merged to 'next' on 2010-03-07 at 5589b26)\n + Documentation: describe new cherry-pick --ff option\n + cherry-pick: add tests for new --ff option\n + revert: add --ff option to allow fast forward when cherry-picking\n + builtin/merge: make checkout_fast_forward() non static\n + parse-options: add parse_options_concat() to concat options\n\n--------------------------------------------------\n[New Topics]\n\n* cw/ws-indent-with-tab (2010-04-01) 2 commits\n - whitespace: we cannot \"catch all errors known to git\" anymore\n - Add tab-in-indent whitespace error class\n\nNot quite ready until \"apply --whitespace=fix\" gets a matching change.\n\n* ic/bash-completion-rpm (2010-03-26) 1 commit\n - RPM spec: include bash completion support\n\nThis is needed in 'master' by -rc1 at the latest.  Soon in 'next'.\n\n* js/grep-open (2010-03-26) 2 commits\n - grep -O: allow optional argument specifying the pager (or editor)\n - grep: Add the option '--open-files-in-pager'\n\nProbably needs to support --no-index mode as well.\n\n* mg/notes-reflog (2010-03-29) 2 commits\n - refs.c: Write reflogs for notes just like for branch heads\n - t3301-notes: Test the creation of reflog entries\n\nImplementation is trivially correct; I am unsure if \"notes\" tree wants\nreflog in the first place, though.  Please convince me and I'll move it\nto 'next' soon, aiming for -rc0 or -rc1 at the latest.\n\n* rr/remote-helper-doc (2010-03-28) 2 commits\n - Documentation/remote-helpers: Fix some typos\n - Documentation/remote-helpers: Rewrite description\n\nAlthough I lost track of this series with too rapid succession of\nupdates, intermixed with some documentation updates in the related\nareas, my impression is that area experts haven't Acked them yet.\n\n* sr/remote-helper-export (2010-03-29) 7 commits\n - remote-helpers: add tests for testgit helper\n - remote-helpers: add testgit helper\n - remote-helpers: add support for an export command\n - remote-helpers: allow requesing the path to the .git directory\n - fast-import: always create marks_file directories\n - clone: also configure url for bare clones\n - clone: pass the remote name to remote_get\n\nMay merge to 'next', but I would prefer waiting til 1.7.2 to have\nthis with a confidence than fast-tracking it.\n\n* cc/revert-strategy (2010-03-31) 5 commits\n - revert: add \"--strategy\" option to choose merge strategy\n - merge: make function try_merge_command non static\n - merge: refactor code that calls \"git merge-STRATEGY\"\n - revert: refactor merge recursive code into its own function\n - revert: use strbuf to refactor the code that writes the merge message\n (this branch uses jn/merge-diff3-label.)\n\nMay merge to 'next' soon, but this is more about debugging and we are not\nin a great hurry.\n\n* mr/gitweb-jsmin (2010-04-01) 6 commits\n - gitweb: update INSTALL to use shorter make target\n - gitweb: add documentation to INSTALL regarding gitweb.js\n - instaweb: add minification awareness\n - Gitweb: add autoconfigure support for minifiers\n - Gitweb: add support for minifying gitweb.css\n - Gitweb: add ignore and clean rules for minified files\n\nSoon in 'next' when minor rewording replacement patches come; otherwise\nfelt solid.\n\n* sc/http-late-auth (2010-04-01) 1 commit\n - Prompt for a username when an HTTP request 401s\n\nMay merge to 'next', but I would prefer waiting til 1.7.2 to have\nthis with a confidence than fast-tracking it.\n\n* hg/convert (2010-03-29) 5 commits\n . convert: Added core.refilteronadd feature.\n . convert: Inhibit contraction of foreign $Id$ during stats.\n . convert: Use the enum constant SAFE_CRLF_FALSE.\n . convert: Keep foreign $Id$ on checkout.\n . convert: Safer handling of $Id$ contraction.\n\n* jk/cached-textconv (2010-04-01) 7 commits\n - diff: avoid useless filespec population\n - diff: cache textconv output\n - textconv: refactor calls to run_textconv\n - introduce notes-cache interface\n - make commit_tree a library function\n - fix textconv leak in emit_rewrite_diff\n - fix const-correctness of write_sha1_file\n\nMay merge to 'next', but I would prefer waiting til 1.7.2 to have\nthis with a confidence than fast-tracking it.\n\n--------------------------------------------------\n[Stalled]\n\n* cw/test-lib-relicense (2010-02-22) 1 commit\n . test-lib.sh: Add explicit license detail, with change from GPLv2 to GPLv2+.\n\nAck-collection stopped at the last three names.  I am hoping Carl can take\nit from there without my keeping an eye on it.\n\n* js/rebase-origin-x (2010-02-05) 1 commit\n - [RFC w/o test and incomplete] rebase: add -x option to record original commit name\n\nI retract my objection against the idea of -x; needs polishing before\nmoving forward.\n\n* sg/bash-completion (2010-02-23) 4 commits\n  (merged to 'next' on 2010-03-08 at bc59860)\n + bash: completion for gitk aliases\n + bash: support user-supplied completion scripts for aliases\n + bash: support user-supplied completion scripts for user's git commands\n + bash: improve aliased command recognition\n\nPerhaps rename _git_frotz -> _git_complete_frotz?  I dunno.\n\n* sd/log-decorate (2010-02-17) 3 commits\n  (merged to 'next' on 2010-03-08 at 58a6fba)\n + log.decorate: usability fixes\n + Add `log.decorate' configuration variable.\n + git_config_maybe_bool()\n\nNeeds squelching the configuration setting when \"--pretty=raw\" is given,\nat least, or possibly when any \"--pretty\" is explicitly given.\n\n* np/malloc-threading (2010-03-24) 1 commit\n - Make xmalloc and xrealloc thread-safe\n\nStill has locking issues?\n\n* js/async-thread (2010-03-09) 7 commits\n - Enable threaded async procedures whenever pthreads is available\n  (merged to 'next' on 2010-03-20 at 9939243)\n + Dying in an async procedure should only exit the thread, not the process.\n + Reimplement async procedures using pthreads\n + Windows: more pthreads functions\n + Fix signature of fcntl() compatibility dummy\n + Make report() from usage.c public as vreportf() and use it.\n + Modernize t5530-upload-pack-error.\n\nWaiting for resolution of locking issues in malloc-threading.\n\n--------------------------------------------------\n[Cooking]\n\n* da/maint-python-startup (2010-03-27) 1 commit\n  (merged to 'next' on 2010-04-01 at ca6897a)\n + Makefile: Remove usage of deprecated Python \"has_key\" method\n\nHopefully will merge to 'master' by -rc0.\n\n* jc/conflict-marker-size (2010-03-24) 1 commit\n  (merged to 'next' on 2010-04-01 at 164b1f4)\n + diff --check: honor conflict-marker-size attribute\n\nHopefully will merge to 'master' by -rc0.\n\n* ld/discovery-limit-to-fs (2010-03-17) 3 commits\n - Add support for GIT_ONE_FILESYSTEM\n - truncate cwd string before printing error message\n - config.c: remove static keyword from git_env_bool()\n\nLinus made a good point of making this a default, and Erick Mattos\nconfirmed that it won't be a problem even on Windows.\n\nWill move to 'next' after such a \"default on\" change, keep it there until\n1.7.1 ships, warn about it in the release notes as an upcoming backward\nincompatibility, and then move to 'master' after 1.7.1.\n\n* sb/fmt-merge-msg (2010-03-24) 7 commits\n  (merged to 'next' on 2010-04-01 at 5fcbec5)\n + fmt-merge-msg: hide summary option\n + fmt-merge-msg: remove custom string_list implementation\n + string-list: add unsorted_string_list_lookup()\n + fmt-merge-msg: use pretty.c routines\n + t6200: test fmt-merge-msg more\n + t6200: modernize with test_tick\n + fmt-merge-msg: be quiet if nothing to merge\n\nHopefully will merge to 'master' by -rc0.\n\n* pc/remove-warn (2010-03-26) 4 commits\n - Remove a redundant errno test in a usage of remove_path\n - Introduce remove_or_warn function\n - Implement the rmdir_or_warn function\n - Generalise the unlink_or_warn function\n\nI cherry-picked only obviously sensible bits.  Soon in 'next'.\n\n* ef/maint-empty-commit-log (2010-03-21) 1 commit\n  (merged to 'next' on 2010-03-28 at aa103e5)\n + rev-list: fix --pretty=oneline with empty message\n\nHopefully will merge to 'master' by -rc0.\n\n* em/checkout-orphan (2010-03-21) 1 commit\n  (merged to 'next' on 2010-03-28 at 86b6a4f)\n + git checkout: create unparented branch by --orphan\n\nPerhaps needs a bit of documentation updates, describing the \"going open\nsource\" scenario.\n\n* mg/mailmap-update (2010-03-19) 1 commit\n  (merged to 'next' on 2010-03-28 at 8ac3436)\n + .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly \"_Vi\" Shukela\n\nSoon in 'master'.\n\n* mg/maint-send-email-lazy-editor (2010-03-22) 1 commit\n  (merged to 'next' on 2010-03-28 at 7e8e58e)\n + send-email: lazily assign editor variable\n\nSoon in 'master'.\n\n* mg/use-default-abbrev-length-in-rev-list (2010-03-22) 1 commit\n  (merged to 'next' on 2010-03-28 at d3e9f04)\n + rev-list: use default abbrev length when abbrev-commit is in effect\n\nSoon in 'master'.\n\n* rb/maint-python-path (2010-03-21) 1 commit\n  (merged to 'next' on 2010-03-28 at 58ba409)\n + Correct references to /usr/bin/python which does not exist on FreeBSD\n\nSoon in 'master'.\n\n* rr/imap-send-unconfuse-from-line (2010-03-22) 1 commit\n  (merged to 'next' on 2010-03-28 at fbedd77)\n + imap-send: Remove limitation on message body\n\nSoon in 'master'.\n\n* sp/maint-http-backend-die-triggers-die-recursively (2010-03-22) 1 commit\n  (merged to 'next' on 2010-03-28 at bf02879)\n + http-backend: Don't infinite loop during die()\n\nSoon in 'master'.\n\n* ar/config-from-command-line (2010-03-26) 2 commits\n - Use strbufs instead of open-coded string manipulation\n - Allow passing of configuration parameters in the command line\n\nMay merge to 'next', but I would prefer waiting til 1.7.2 to have\nthis with a confidence than fast-tracking it.\n\n* bc/t5505-fix (2010-03-19) 3 commits\n  (merged to 'next' on 2010-03-28 at 1b097af)\n + t/t5505-remote.sh: escape * to prevent interpretation by shell as glob\n + t5505: add missing &&\n + t5505: remove unnecessary subshell invocations\n\nSoon in 'master'.\n\n* bw/template-tool-buildconfig (2010-03-20) 2 commits\n  (merged to 'next' on 2010-03-28 at 1e6fd8d)\n + Modernize git calling conventions in hook templates\n + Make templates honour SHELL_PATH and PERL_PATH\n\nSoon in 'master'.\n\n* mb/rebase-i-no-ff (2010-03-24) 1 commit\n  (merged to 'next' on 2010-03-28 at b2c54cb)\n + Teach rebase the --no-ff option.\n\nSoon in 'master'.\n\n* jn/merge-diff3-label (2010-03-20) 14 commits\n  (merged to 'next' on 2010-03-20 at 26f1805)\n + merge-recursive: add a label for ancestor\n + cherry-pick, revert: add a label for ancestor\n + revert: clarify label on conflict hunks\n + compat: add mempcpy()\n + checkout -m --conflict=diff3: add a label for ancestor\n + merge_trees(): add ancestor label parameter for diff3-style output\n + merge_file(): add comment explaining behavior wrt conflict style\n + checkout --conflict=diff3: add a label for ancestor\n + ll_merge(): add ancestor label parameter for diff3-style output\n + merge-file --diff3: add a label for ancestor\n + xdl_merge(): move file1 and file2 labels to xmparam structure\n + xdl_merge(): add optional ancestor label to diff3-style output\n + tests: document cherry-pick behavior in face of conflicts\n + tests: document format of conflicts from checkout -m\n (this branch is used by cc/revert-strategy.)\n\nSoon in 'master'.\n\n* do/rebase-i-arbitrary (2010-03-14) 1 commit\n  (merged to 'next' on 2010-03-28 at 5ba9970)\n + rebase--interactive: don't require what's rebased to be a branch\n\nSoon in 'master'.\n\n* ja/send-email-ehlo (2010-03-14) 3 commits\n  (merged to 'next' on 2010-03-28 at 00964a8)\n + git-send-email.perl - try to give real name of the calling host to HELO/EHLO\n + git-send-email.perl: add option --smtp-debug\n + git-send-email.perl: improve error message in send_message()\n\nSoon in 'master'.\n\n* ak/everyday-git (2009-10-21) 1 commit\n  (merged to 'next' on 2010-03-28 at ae67548)\n + everyday: fsck and gc are not everyday operations\n\nSoon in 'master'.\n\n* bc/acl-test (2010-03-15) 5 commits\n  (merged to 'next' on 2010-03-28 at b40fa09)\n + t/t1304: make a second colon optional in the mask ACL check\n + t/t1304: set the ACL effective rights mask\n + t/t1304: use 'test -r' to test readability rather than looking at mode bits\n + t/t1304: set the Default ACL base entries\n + t/t1304: avoid -d option to setfacl\n\nSoon in 'master'.\n\n* bc/maint-daemon-sans-ss-family (2010-03-15) 1 commit\n  (merged to 'next' on 2010-03-28 at 305ad0b)\n + daemon.c: avoid accessing ss_family member of struct sockaddr_storage\n\nSoon in 'master'.\n\n* ef/cherry-abbrev (2010-03-20) 2 commits\n  (merged to 'next' on 2010-03-28 at eb3825c)\n + ls: remove redundant logic\n + cherry: support --abbrev option\n\nSoon in 'master'.\n\n* gh/maint-stash-show-error-message (2010-03-16) 1 commit\n  (merged to 'next' on 2010-03-28 at 61a5643)\n + Improve error messages from 'git stash show'\n\nSoon in 'master'.\n\n* rs/threaded-grep-context (2010-03-15) 1 commit\n  (merged to 'next' on 2010-03-28 at 1934af1)\n + grep: enable threading for context line printing\n\nSoon in 'master'.\n\n* nd/setup (2010-03-25) 43 commits\n - builtins: do not commit pager choice early\n - builtins: reset startup_info->have_run_setup_gitdir when unsetting up repository\n - builtins: setup repository before print unknown command error\n - Guard unallowed access to repository when it's not set up\n - alias: keep repository found while collecting aliases as long as possible\n - Allow to undo setup_git_directory_gently() gracefully (and fix alias code)\n - builtins: check for startup_info->help, print and exit early\n - builtins: utilize startup_info->help where possible\n - run_builtin(): save \"-h\" detection result for later use\n - config: do not read .git/config if there is no repository\n - apply: do not check sha1 when repository has not been found\n - Do not read .git/info/attributes if there is no repository\n - Do not read .git/info/exclude if there is no repository\n - git_config(): do not read .git/config if there is no repository\n - init/clone: turn on startup->have_repository properly\n - worktree setup: restore original state when things go wrong\n - Use git_config_early() instead of git_config() during repo setup\n - Add git_config_early()\n - worktree setup: call set_git_dir explicitly\n - rev-parse --git-dir: print relative gitdir correctly\n - enter_repo(): initialize other variables as setup_git_directory_gently() does\n - Move enter_repo() to setup.c\n - index-pack: use RUN_SETUP_GENTLY\n - index-pack: trust the prefix returned by setup_git_directory_gently()\n - worktree setup: calculate prefix even if no worktree is found\n - merge-file: use RUN_SETUP_GENTLY\n - var: use RUN_SETUP_GENTLY\n - ls-remote: use RUN_SETUP_GENTLY\n - help: use RUN_SETUP_GENTLY\n - diff: use RUN_SETUP_GENTLY\n - bundle: use RUN_SETUP_GENTLY\n - apply: use RUN_SETUP_GENTLY\n - verify-pack: use RUN_SETUP_GENTLY\n - check-ref-format: use RUN_SETUP_GENTLY\n - mailinfo: use RUN_SETUP_GENTLY\n - archive: use RUN_SETUP_GENTLY\n - builtin: USE_PAGER should not be used without RUN_SETUP*\n - grep: use RUN_SETUP_GENTLY\n - shortlog: use RUN_SETUP_GENTLY\n - hash-object: use RUN_SETUP_GENTLY\n - config: use RUN_SETUP_GENTLY\n - builtin: Support RUN_SETUP_GENTLY to set up repository early if found\n - builtin: introduce startup_info struct\n"},{"id":"138417","messageId":"j2wfcaeb9bf1004020423nc5b7a73cq2278d41d1675dc8f@mail.gmail.com","threadId":"23298","inReplyTo":"7vaatmckmi.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Apr 2010, #01; Fri, 02)","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-04-02T11:23:51Z","receivedAt":"2010-04-02T11:23:51Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Fri, Apr 2, 2010 at 10:40 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> * nd/setup (2010-03-25) 43 commits\n>  - builtins: do not commit pager choice early\n> ...\n>  - builtin: introduce startup_info struct\n\nI haven't forgotten the \"git init\" with alias bug Jonathan found. Just\na little busy with other stuff.\n-- \nDuy\n"},{"id":"138437","messageId":"w2jfabb9a1e1004020948m159174faj3240eee211986fc2@mail.gmail.com","threadId":"23298","inReplyTo":"7vaatmckmi.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Apr 2010, #01; Fri, 02)","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-04-02T16:48:39Z","receivedAt":"2010-04-02T16:48:39Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Fri, Apr 2, 2010 at 02:40, Junio C Hamano <gitster@pobox.com> wrote:\n> * sr/remote-helper-export (2010-03-29) 7 commits\n>  - remote-helpers: add tests for testgit helper\n>  - remote-helpers: add testgit helper\n>  - remote-helpers: add support for an export command\n>  - remote-helpers: allow requesing the path to the .git directory\n>  - fast-import: always create marks_file directories\n>  - clone: also configure url for bare clones\n>  - clone: pass the remote name to remote_get\n>\n> May merge to 'next', but I would prefer waiting til 1.7.2 to have\n> this with a confidence than fast-tracking it.\n\nAgreed, if 1.7.2 will be a short cycle I don't mind waiting a few more weeks :).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"138490","messageId":"alpine.LFD.2.00.1004030055110.694@xanadu.home","threadId":"23298","inReplyTo":"7vaatmckmi.fsf@alter.siamese.dyndns.org","subject":"Re: What's cooking in git.git (Apr 2010, #01; Fri, 02)","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2010-04-03T04:58:14Z","receivedAt":"2010-04-03T04:58:14Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 2 Apr 2010, Junio C Hamano wrote:\n\n> * np/malloc-threading (2010-03-24) 1 commit\n>  - Make xmalloc and xrealloc thread-safe\n> \n> Still has locking issues?\n\nIndeed.\n\n\nNicolas\n"},{"id":"138491","messageId":"20100403050057.GA20525@progeny.tock","threadId":"23298","inReplyTo":"j2wfcaeb9bf1004020423nc5b7a73cq2278d41d1675dc8f@mail.gmail.com","subject":"nd/setup","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-04-03T05:00:57Z","receivedAt":"2010-04-03T05:00:57Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyen Thai Ngoc Duy wrote:\n\n> I haven't forgotten the \"git init\" with alias bug Jonathan found. Just\n> a little busy with other stuff.\n\nYou already fixed it, I think. ;-)\n\nUnfortunately, I have also run into a double-initialization bug with\nclone.  I haven’t figured out how to reproduce it yet; once I do, I’ll\nsend a patch.\n\nOverall, I think this series does a good thing, so I am anxious to find\nall the bugs I can so the wrinkles get ironed out.\n\nHere’s another tiny issue.\n\n-- %< --\nSubject: Revert \"help: use RUN_SETUP_GENTLY\"\n\nCommit 717b8850580ecb9009505f71ea43ecda51ac1f0e taught ‘git help’\nto unconditionally looks for a git directory, with the justification:\n\n    So the sooner we set up gitdir, the less trouble we may have to\n    deal with.\n\nIn the case of ‘git help -a’, that is not quite true.  In automount\nsetups like that which prompted v1.6.0-rc0~121^2~1 (Add support for\nGIT_CEILING_DIRECTORIES, 2008-05-19), if GIT_CEILING_DIRECTORIES is\nunset, then probing for the Git directory can take a long time.  Thus\nunnecessarily searching for a git directory can slow down ‘git help -a’\n(and thus bash completion).\n\n‘git help’ does not use RUN_SETUP or USE_PAGER, and neither option\nparsing nor producing output for plain ‘git help’ or ‘git help -a’\nrequires access to the git configuration.  Therefore it is safe to not\nsearch for the git directory early in this case.\n\nAlso add some comments to document the requirements this places on\nlist_commands() and list_common_cmds_help().\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n builtin/help.c |    7 +++++++\n git.c          |    2 +-\n help.c         |    4 ++++\n 3 files changed, 12 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 4988629..68b72df 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -271,6 +271,11 @@ static int git_help_config(const char *var, const char *value, void *cb)\n \n static struct cmdnames main_cmds, other_cmds;\n \n+/*\n+ * Used for plain ‘git’ and ‘git help’.\n+ * Therefore this should not use git_config(), nor any other function\n+ * that requires searching for a repository.\n+ */\n void list_common_cmds_help(void)\n {\n \tint i, longest = 0;\n@@ -414,6 +419,7 @@ static void show_html_page(const char *git_cmd)\n \n int cmd_help(int argc, const char **argv, const char *prefix)\n {\n+\tint unused_nongit;\n \tconst char *alias;\n \tenum help_format parsed_help_format;\n \tload_command_list(\"git-\", &main_cmds, &other_cmds);\n@@ -436,6 +442,7 @@ int cmd_help(int argc, const char **argv, const char *prefix)\n \t\treturn 0;\n \t}\n \n+\tsetup_git_directory_gently(&unused_nongit);\n \tgit_config(git_help_config, NULL);\n \n \tif (parsed_help_format != HELP_FORMAT_NONE)\ndiff --git a/git.c b/git.c\nindex 5c249fd..0125152 100644\n--- a/git.c\n+++ b/git.c\n@@ -335,7 +335,7 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"get-tar-commit-id\", cmd_get_tar_commit_id },\n \t\t{ \"grep\", cmd_grep, RUN_SETUP_GENTLY | USE_PAGER },\n \t\t{ \"hash-object\", cmd_hash_object, RUN_SETUP_GENTLY },\n-\t\t{ \"help\", cmd_help, RUN_SETUP_GENTLY },\n+\t\t{ \"help\", cmd_help },\n \t\t{ \"index-pack\", cmd_index_pack, RUN_SETUP_GENTLY },\n \t\t{ \"init\", cmd_init_db },\n \t\t{ \"init-db\", cmd_init_db },\ndiff --git a/help.c b/help.c\nindex 7f4928e..f68ef43 100644\n--- a/help.c\n+++ b/help.c\n@@ -221,6 +221,10 @@ void load_command_list(const char *prefix,\n \texclude_cmds(other_cmds, main_cmds);\n }\n \n+/*\n+ * Used for ‘git help -a’.  Therefore this should not use git_config(),\n+ * nor any other function that requires searching for a repository.\n+ */\n void list_commands(const char *title, struct cmdnames *main_cmds,\n \t\t   struct cmdnames *other_cmds)\n {\n-- \n1.7.0.3\n"},{"id":"138500","messageId":"z2gfcaeb9bf1004030739q9575b629p44c4461e90c37d40@mail.gmail.com","threadId":"23298","inReplyTo":"20100403050057.GA20525@progeny.tock","subject":"Re: nd/setup","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-04-03T14:39:05Z","receivedAt":"2010-04-03T14:39:05Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Apr 3, 2010 at 7:00 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Nguyen Thai Ngoc Duy wrote:\n>\n>> I haven't forgotten the \"git init\" with alias bug Jonathan found. Just\n>> a little busy with other stuff.\n>\n> You already fixed it, I think. ;-)\n\nHmm.. so I do forget something. I still miss some of your good tests though.\n\n> -- %< --\n> Subject: Revert \"help: use RUN_SETUP_GENTLY\"\n>\n> Commit 717b8850580ecb9009505f71ea43ecda51ac1f0e taught ‘git help’\n> to unconditionally looks for a git directory, with the justification:\n>\n>    So the sooner we set up gitdir, the less trouble we may have to\n>    deal with.\n>\n> In the case of ‘git help -a’, that is not quite true.  In automount\n> setups like that which prompted v1.6.0-rc0~121^2~1 (Add support for\n> GIT_CEILING_DIRECTORIES, 2008-05-19), if GIT_CEILING_DIRECTORIES is\n> unset, then probing for the Git directory can take a long time.  Thus\n> unnecessarily searching for a git directory can slow down ‘git help -a’\n> (and thus bash completion).\n>\n> ‘git help’ does not use RUN_SETUP or USE_PAGER, and neither option\n> parsing nor producing output for plain ‘git help’ or ‘git help -a’\n> requires access to the git configuration.  Therefore it is safe to not\n> search for the git directory early in this case.\n>\n> Also add some comments to document the requirements this places on\n> list_commands() and list_common_cmds_help().\n>\n> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>\n\nDidn't notice it. Looks good. I will replace the \"help: use\nRUN_SETUP_GENTLY\" commit with this patch next time, if you don't mind.\n-- \nDuy\n"},{"id":"138549","messageId":"j2mfcaeb9bf1004041141p28fba95dz5cb11918c172d32f@mail.gmail.com","threadId":"23298","inReplyTo":"20100403050057.GA20525@progeny.tock","subject":"Re: nd/setup","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-04-04T18:41:40Z","receivedAt":"2010-04-04T18:41:40Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Junio,\n\nI wanted to update nd/setup topic, but found nd/root-git was merged in\nbetween its two parts, which resulted in non-trivial conflicts in the\nend. Changes are minor, mainly to clean up the topic. So it's up to\nyou to either leave the topic as is (plus Jonathan's \"help revert\"\npatch on top) or replace with some patches I attach, because if I send\nthe whole topic again, you would need to resolve conflicts manually.\nI'll make proper patch messages next time once I figure out how to\nsend conflict resolutions through mail.\n\n- 717b885 help: use RUN_SETUP_GENTLY\n  replaced by 0001 (needs to resolve conflict in the next patch in\ntopic, but it's quite simple)\n- 450476a worktree setup: restore original state when things go wrong\n  replaced by 0002\n- bc7cd1c Guard unallowed access to repository when it's not set up\n  replaced by 0003 and 0004\n- a55fdda builtins: reset startup_info->have_run_setup_gitdir when\nunsetting up repository\n  dropped (splitted as part of 0002-0004)\n--\nDuy\n\n\nFrom 4c5d6bc49e262d3331069dd7d8fb8fc6785f5d4b Mon Sep 17 00:00:00 2001\nFrom: Jonathan Nieder <jrnieder@gmail.com>\nDate: Sun, 4 Apr 2010 17:49:38 +0200\nSubject: [PATCH] help: take note why this command is not applicable for RUN_SETUP_GENTLY\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n\"git help\" calls setup_git_directory_gently(), thus a candidate for\nRUN_SETUP_GENTLY. However RUN_SETUP_GENTLY should not be used for\nperformance reason, as follows.\n\nIn automount setups like that which prompted v1.6.0-rc0~121^2~1 (Add\nsupport for GIT_CEILING_DIRECTORIES, 2008-05-19), if\nGIT_CEILING_DIRECTORIES is unset, then probing for the Git directory\ncan take a long time.  Thus unnecessarily searching for a git\ndirectory can slow down 'git help -a' (and thus bash completion).\n\n'git help' does not use RUN_SETUP or USE_PAGER, and neither option\nparsing nor producing output for plain 'git help' or 'git help -a'\nrequires access to the git configuration.  Therefore it is safe to not\nsearch for the git directory early in this case.\n\nAlso add some comments to document the requirements this places on\nlist_commands() and list_common_cmds_help().\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/help.c |    5 +++++\n help.c         |    4 ++++\n 2 files changed, 9 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin/help.c b/builtin/help.c\nindex 3182a2b..1626251 100644\n--- a/builtin/help.c\n+++ b/builtin/help.c\n@@ -271,6 +271,11 @@ static int git_help_config(const char *var, const char *value, void *cb)\n \n static struct cmdnames main_cmds, other_cmds;\n \n+/*\n+ * Used for plain 'git' and 'git help'.\n+ * Therefore this should not use git_config(), nor any other function\n+ * that requires searching for a repository.\n+ */\n void list_common_cmds_help(void)\n {\n \tint i, longest = 0;\ndiff --git a/help.c b/help.c\nindex 7f4928e..d4c3165 100644\n--- a/help.c\n+++ b/help.c\n@@ -221,6 +221,10 @@ void load_command_list(const char *prefix,\n \texclude_cmds(other_cmds, main_cmds);\n }\n \n+/*\n+ * Used for 'git help -a'.  Therefore this should not use git_config(),\n+ * nor any other function that requires searching for a repository.\n+ */\n void list_commands(const char *title, struct cmdnames *main_cmds,\n \t\t   struct cmdnames *other_cmds)\n {\n-- \n1.7.0.rc1.541.g2da82.dirty\n\n\n\nFrom 092b20337ac1f1824a6656ba5249b409626ca52e Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= <pclouds@gmail.com>\nDate: Sun, 21 Mar 2010 17:30:34 +0700\nSubject: [PATCH] worktree setup: restore original state when things go wrong\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nIn current state of setup_git_directory_gently(), when a repository is\nnot found, many things will not be the same as when setup procedure is\nstarted (while they should be). For one thing, current working\ndirectory will not be the same in certain cases.\n\nThis patch reorders actions in clear steps and rolls back if one step\nis wrong. (Actually the last step, setting git_dir, can't be rolled\nback by this patch).\n\nThe steps and their state change are:\n\n 1. Looking in working directory for repository candidates (or $GIT_DIR\n    if it is set)\n\n    This step may move $(cwd) to somewhere.\n\n 2. Set internal variables to record repository features, based only\n    on repository location and environment variables.\n\n    This step sets variables:\n    - inside_git_dir\n    - inside_work_tree\n\n 3. Inspect $GIT_DIR/config to see if it's a valid repository.\n\n    This step may change variables:\n    - repository_format_version\n    - shared_repository\n    - is_bare_repository_cfg\n    - git_work_tree_cfg\n\n 4. Save the repository location for later use.\n\n    This step calls setup_git_dir() to set many variables in environment.c\n\n 5. Calculate prefix (relative path to the original current working\n    directory)\n\nSetup procedure is completed at step 5. Stopping at any other steps\nis considered a setup failure.\n\nIn case of setup failure, if it's not fatal and nongit_ok is not NULL,\nprefix must be calculated before returning to caller. In other words:\n\n  if (!fatal && gently)\n    goto step_5;\n\nThings that go wrong before step 4 will be cleaned up by\nunset_git_directory(). Step 4 is irreversible, for now.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n cache.h |    1 +\n setup.c |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----\n 2 files changed, 52 insertions(+), 4 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 57cd79e..4debeaa 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -409,6 +409,7 @@ extern const char **get_pathspec(const char *prefix, const char **pathspec);\n extern void setup_work_tree(void);\n extern const char *setup_git_directory_gently(int *);\n extern const char *setup_git_directory(void);\n+extern void unset_git_directory(const char *prefix);\n extern const char *prefix_path(const char *prefix, int len, const char *path);\n extern const char *prefix_filename(const char *prefix, int len, const char *path);\n extern int check_filename(const char *prefix, const char *name);\ndiff --git a/setup.c b/setup.c\nindex 19fe3e3..908cfff 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -322,6 +322,42 @@ const char *read_gitfile_gently(const char *path)\n \treturn path;\n }\n \n+void unset_git_directory(const char *prefix)\n+{\n+\t/*\n+\t * FIXME:\n+\t * chdir(prefix) may be enough for most of cases,\n+\t * if original cwd is outside worktree, prefix\n+\t * will always be set NULL, thus impossible to move\n+\t * back to orignal cwd\n+\t */\n+\tif (prefix && chdir(prefix))\n+\t\tdie(\"Cannot change to '%s'\", prefix);\n+\n+\tif (startup_info) {\n+\t\tstartup_info->prefix = NULL;\n+\t\tstartup_info->have_repository = 0;\n+\t}\n+\n+\t/* Initialized in setup_git_directory_gently_1() */\n+\tinside_work_tree = -1;\n+\tinside_git_dir = -1;\n+\n+\t/* Initialized in check_repository_format_version() */\n+\t/*\n+\t * repository_format_version is zero for two reasons:\n+\t * - For really old repos, there won't be core.repositoryformatversion\n+\t *   we treat it as supported version zero.\n+\t * - For repo creating commands like \"git init\" or \"git clone\"\n+\t *   $GIT_DIR/config may not be there, just let it pass, the\n+\t *   repository will be properly initialized later.\n+\t * For history of this setting see commits 4f62953 and 96f1e58\n+\t */\n+\trepository_format_version = 0;\n+\tshared_repository = PERM_UMASK;\n+\tis_bare_repository_cfg = -1;\n+\tgit_work_tree_cfg = NULL;\n+}\n /*\n  * We cannot decide in this function whether we are in the work tree or\n  * not, since the config can only be read _after_ this function was called.\n@@ -402,6 +438,13 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t * - ../ (bare)\n \t * - ../../.git/\n \t *   etc.\n+\t *\n+\t * When a repository is found:\n+\t * - inside_git_dir/inside_work_tree are set\n+\t * - check_repository_format_gently() is called\n+\t *   if repo version is not supported, restore cwd\n+\t * - set_git_dir\n+\t * - calculate and return prefix\n \t */\n \toffset = len = strlen(cwd);\n \tfor (;;) {\n@@ -409,13 +452,15 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\tif (!gitfile_dir && is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))\n \t\t\tgitfile_dir = DEFAULT_GIT_DIR_ENVIRONMENT;\n \t\tif (gitfile_dir) {\n-\t\t\tif (set_git_dir(gitfile_dir))\n-\t\t\t\tdie(\"Repository setup failed\");\n \t\t\tinside_git_dir = 0;\n \t\t\tif (!work_tree_env)\n \t\t\t\tinside_work_tree = 1;\n-\t\t\tif (check_repository_format_gently(gitfile_dir, nongit_ok))\n+\t\t\tif (check_repository_format_gently(gitfile_dir, nongit_ok)) {\n+\t\t\t\tunset_git_directory(offset != len ? cwd + offset + 1: NULL);\n \t\t\t\treturn NULL;\n+\t\t\t}\n+\t\t\tif (set_git_dir(gitfile_dir))\n+\t\t\t\tdie(\"Repository setup failed\");\n \t\t\troot_len = offset_1st_component(cwd);\n \t\t\tgit_work_tree_cfg = xstrndup(cwd, offset > root_len ? offset : root_len);\n \t\t\tbreak;\n@@ -424,8 +469,10 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\t\tinside_git_dir = 1;\n \t\t\tif (!work_tree_env)\n \t\t\t\tinside_work_tree = 0;\n-\t\t\tif (check_repository_format_gently(\".\", nongit_ok))\n+\t\t\tif (check_repository_format_gently(\".\", nongit_ok)) {\n+\t\t\t\tunset_git_directory(offset != len ? cwd + offset + 1: NULL);\n \t\t\t\treturn NULL;\n+\t\t\t}\n \t\t\tif (offset != len) {\n \t\t\t\tcwd[offset] = '\\0';\n \t\t\t\tset_git_dir(cwd);\n-- \n1.7.0.rc1.541.g2da82.dirty\n\n\n\nFrom 1c1e4af05262b57f5779e7f825e25945c8c21754 Mon Sep 17 00:00:00 2001\nFrom: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= <pclouds@gmail.com>\nDate: Sun, 21 Mar 2010 17:30:46 +0700\nSubject: [PATCH] Guard unallowed access to repository when it's not set up\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nMany code path will skip repo access if startup_info->have_repository\nis false. This may be a fault if startup_info->have_repository has not\nbeen properly initialized.\n\nSo the rule is one of the following commands must be run before any\nrepo access. And none of them can be called twice.\n\n - setup_git_directory*\n - enter_repo\n - init_db\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n builtin/init-db.c |    1 +\n cache.h           |    1 +\n config.c          |    2 ++\n environment.c     |   13 +++++++++++--\n git.c             |   16 +++++++++++-----\n setup.c           |   13 +++++++++++++\n 6 files changed, 39 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/init-db.c b/builtin/init-db.c\nindex 5b2113b..8242fb9 100644\n--- a/builtin/init-db.c\n+++ b/builtin/init-db.c\n@@ -288,6 +288,7 @@ int init_db(const char *git_dir, const char *template_dir, unsigned int flags)\n \n \tset_git_dir(make_absolute_path(git_dir));\n \tstartup_info->have_repository = 1;\n+\tstartup_info->have_run_setup_gitdir = 1;\n \n \tsafe_create_dir(get_git_dir(), 0);\n \ndiff --git a/cache.h b/cache.h\nindex 1b55ad7..c118935 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -1046,6 +1046,7 @@ int split_cmdline(char *cmdline, const char ***argv);\n /* git.c */\n struct startup_info {\n \tconst char *prefix;\n+\tint have_run_setup_gitdir;\n \tint have_repository;\n \tint help;\n };\ndiff --git a/config.c b/config.c\nindex 07d854a..9981b09 100644\n--- a/config.c\n+++ b/config.c\n@@ -737,6 +737,8 @@ int git_config(config_fn_t fn, void *data)\n \tchar *repo_config = NULL;\n \tint ret;\n \n+\tif (startup_info && !startup_info->have_run_setup_gitdir)\n+\t\tdie(\"internal error: access to .git/config without repo setup\");\n \tif (!startup_info || startup_info->have_repository)\n \t\trepo_config = git_pathdup(\"config\");\n \tret = git_config_early(fn, data, repo_config);\ndiff --git a/environment.c b/environment.c\nindex ead00a3..ca34a7b 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -81,9 +81,18 @@ void unset_git_env(void)\n \n static void setup_git_env(void)\n {\n+\tif (startup_info && startup_info->have_run_setup_gitdir)\n+\t\tdie(\"internal error: setup_git_env can't be called twice\");\n \tgit_dir = getenv(GIT_DIR_ENVIRONMENT);\n-\tif (!git_dir)\n-\t\tgit_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);\n+\tif (!git_dir) {\n+\t\t/*\n+\t\t * Repo detection should be done by setup_git_directory*\n+\t\t * or enter_repo, not by this function\n+\t\t */\n+\t\t if (startup_info)\n+\t\t\t die(\"internal error: $GIT_DIR is empty\");\n+\t\t git_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);\n+\t}\n \tif (!git_dir)\n \t\tgit_dir = DEFAULT_GIT_DIR_ENVIRONMENT;\n \tgit_object_dir = getenv(DB_ENVIRONMENT);\ndiff --git a/git.c b/git.c\nindex deba49a..21272d8 100644\n--- a/git.c\n+++ b/git.c\n@@ -242,11 +242,14 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)\n \t\t\tint nongit_ok;\n \t\t\tsetup_git_directory_gently(&nongit_ok);\n \t\t}\n-\t\telse if (startup_info->have_repository) {\n-\t\t\tif (p->option & (RUN_SETUP_GENTLY | RUN_SETUP))\n-\t\t\t\t; /* done already */\n-\t\t\telse\n-\t\t\t\tunset_git_directory(startup_info->prefix);\n+\t\telse if (startup_info->have_run_setup_gitdir) {\n+\t\t\tif (startup_info->have_repository) {\n+\t\t\t\tif (p->option & (RUN_SETUP_GENTLY | RUN_SETUP))\n+\t\t\t\t\t; /* done already */\n+\t\t\t\telse\n+\t\t\t\t\tunset_git_directory(startup_info->prefix);\n+\t\t\t}\n+\t\t\tstartup_info->have_run_setup_gitdir = 0;\n \t\t}\n \n \t\tif (use_pager == -1 && p->option & RUN_SETUP)\n@@ -257,6 +260,9 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)\n \t\t\tuse_pager = 1;\n \t\t}\n \t}\n+\telse\n+\t\t/* Stop git_config() from complaining that no repository found. */\n+\t\tstartup_info->have_run_setup_gitdir = 1;\n \tcommit_pager_choice();\n \n \tif (!startup_info->help && p->option & NEED_WORK_TREE)\ndiff --git a/setup.c b/setup.c\nindex 7938481..3bb3a92 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -236,7 +236,17 @@ void setup_work_tree(void)\n \t\tgit_dir = make_absolute_path(git_dir);\n \tif (!work_tree || chdir(work_tree))\n \t\tdie(\"This operation must be run in a work tree\");\n+\n+\t/*\n+\t * have_run_setup_gitdir is unset in order to avoid die()ing\n+\t * inside set_git_env(). We don't actually initialize\n+\t * repo twice, we're just relative-izing gitdir\n+\t */\n+\tif (startup_info)\n+\t\tstartup_info->have_run_setup_gitdir = 0;\n \tset_git_dir(make_relative_path(git_dir, work_tree));\n+\tif (startup_info)\n+\t\tstartup_info->have_run_setup_gitdir = 1;\n \tinitialized = 1;\n }\n \n@@ -339,6 +349,7 @@ void unset_git_directory(const char *prefix)\n \t\t\tunset_git_env();\n \t\tstartup_info->prefix = NULL;\n \t\tstartup_info->have_repository = 0;\n+\t\tstartup_info->have_run_setup_gitdir = 0;\n \t}\n \n \t/* Initialized in setup_git_directory_gently_1() */\n@@ -513,6 +524,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \tprefix = setup_git_directory_gently_1(nongit_ok);\n \tif (startup_info) {\n \t\tstartup_info->prefix = prefix;\n+\t\tstartup_info->have_run_setup_gitdir = 1;\n \t\tstartup_info->have_repository = !nongit_ok || !*nongit_ok;\n \t}\n \treturn prefix;\n@@ -607,6 +619,7 @@ char *enter_repo(char *path, int strict)\n \t\tset_git_dir(\".\");\n \t\tif (startup_info) {\n \t\t\tstartup_info->prefix = NULL;\n+\t\t\tstartup_info->have_run_setup_gitdir = 1;\n \t\t\tstartup_info->have_repository = 1;\n \t\t}\n \t\treturn path;\n-- \n1.7.0.rc1.541.g2da82.dirty\n\n\n\nFrom 7c50eebbefc1a1afe665a0315b1416b35c2021e0 Mon Sep 17 00:00:00 2001\nFrom: Jonathan Nieder <jrnieder@gmail.com>\nDate: Sun, 4 Apr 2010 18:16:53 +0200\nSubject: [PATCH] t0001: Add test cases for \"git init\" with aliases\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\n\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n t/t0001-init.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 52 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0001-init.sh b/t/t0001-init.sh\nindex 5386504..245c01a 100755\n--- a/t/t0001-init.sh\n+++ b/t/t0001-init.sh\n@@ -33,6 +33,58 @@ test_expect_success 'plain' '\n \tcheck_config plain/.git false unset\n '\n \n+test_expect_success 'plain nested in bare' '\n+\t(\n+\t\tunset GIT_DIR GIT_WORK_TREE &&\n+\t\tgit init --bare bare-ancestor.git &&\n+\t\tcd bare-ancestor.git &&\n+\t\tmkdir plain-nested &&\n+\t\tcd plain-nested &&\n+\t\tgit init\n+\t) &&\n+\tcheck_config bare-ancestor.git/plain-nested/.git false unset\n+'\n+\n+test_expect_success 'plain through aliased command' '\n+\t(\n+\t\tunset GIT_DIR GIT_WORK_TREE GIT_CONFIG_NOGLOBAL &&\n+\t\tHOME=$(pwd)/alias-config &&\n+\t\texport HOME &&\n+\t\tmkdir alias-config &&\n+\t\techo \"[alias] aliasedinit = init\" >alias-config/.gitconfig &&\n+\t\tmkdir plain-aliased &&\n+\t\tcd plain-aliased &&\n+\t\tgit aliasedinit\n+\t) &&\n+\tcheck_config plain-aliased/.git false unset\n+'\n+\n+test_expect_success 'plain nested through aliased command' '\n+\t(\n+\t\tunset GIT_DIR GIT_WORK_TREE &&\n+\t\tgit init plain-ancestor-aliased &&\n+\t\tcd plain-ancestor-aliased &&\n+\t\techo \"[alias] aliasedinit = init\" >>.git/config &&\n+\t\tmkdir plain-nested &&\n+\t\tcd plain-nested &&\n+\t\tgit aliasedinit\n+\t) &&\n+\tcheck_config plain-ancestor-aliased/plain-nested/.git false unset\n+'\n+\n+test_expect_success 'plain nested in bare through aliased command' '\n+\t(\n+\t\tunset GIT_DIR GIT_WORK_TREE &&\n+\t\tgit init --bare bare-ancestor-aliased.git &&\n+\t\tcd bare-ancestor-aliased.git &&\n+\t\techo \"[alias] aliasedinit = init\" >>config &&\n+\t\tmkdir plain-nested &&\n+\t\tcd plain-nested &&\n+\t\tgit aliasedinit\n+\t) &&\n+\tcheck_config bare-ancestor-aliased.git/plain-nested/.git false unset\n+'\n+\n test_expect_success 'plain with GIT_WORK_TREE' '\n \tif (\n \t\tunset GIT_DIR\n-- \n1.7.0.rc1.541.g2da82.dirty\n\n"},{"id":"138561","messageId":"7vfx3a7v3b.fsf@alter.siamese.dyndns.org","threadId":"23298","inReplyTo":"j2mfcaeb9bf1004041141p28fba95dz5cb11918c172d32f@mail.gmail.com","subject":"Re: nd/setup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-04T21:42:48Z","receivedAt":"2010-04-04T21:42:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> I wanted to update nd/setup topic, but found nd/root-git was merged in\n> between its two parts, which resulted in non-trivial conflicts in the\n> end.\n\nI am not quite sure what you want me to do.  Replacing these named commits\nin place (meaning, the merge with nd/root-git to adjust the later parts\nthat depend on that fix is reproduced while rebuilding the topic) has some\nsilly conflicts, and rebuilding the whole series without the merge but\nwith the named commits replaced has different conflicts.\n\nAs the fix of nd/root-git is already in 'master', it might make more sense\nto apply the whole series rebased to the newer codebase instead of keeping\nthe same fork point as the older series.  That also removes the worries\nfor you about having to send conflict resolutions, no?\n"}]}