{"thread":{"id":"12933","subject":"[BUG] aliases not working outside of a working copy","startedAt":"2008-03-31T15:19:10Z","lastAt":"2008-04-01T08:04:06Z","messageCount":4,"participants":["Santi Béjar","Johannes Schindelin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"73438","messageId":"8aa486160803310819r3a905bbeg5f993a55aaf6efbf@mail.gmail.com","threadId":"12933","inReplyTo":null,"subject":"[BUG] aliases not working outside of a working copy","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-03-31T15:19:10Z","receivedAt":"2008-03-31T15:19:10Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"Hi *,\n\n  I use the following alias:\n\n[alias]\n        wdiff = diff --color-words\n\nand it no longer works outside of a working copy since:\n\naf05d67 (Always set *nongit_ok in setup_git_directory_gently())\n\nThe problem is with the alias system that detects if you are in a\nworking copy, not with the command, as the\ncommand just works fine.\n\nSanti\n"},{"id":"73439","messageId":"alpine.LSU.1.00.0803311745170.18259@racer.site","threadId":"12933","inReplyTo":"8aa486160803310819r3a905bbeg5f993a55aaf6efbf@mail.gmail.com","subject":"Re: [BUG] aliases not working outside of a working copy","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-03-31T15:46:04Z","receivedAt":"2008-03-31T15:46:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 31 Mar 2008, Santi Béjar wrote:\n\n> af05d67 (Always set *nongit_ok in setup_git_directory_gently())\n> \n> The problem is with the alias system that detects if you are in a\n> working copy, not with the command, as the\n> command just works fine.\n\nAh, right.  I think that this hunk:\n\ndiff --git a/git.c b/git.c\nindex 13de801..b7729d7 100644\n--- a/git.c\n+++ b/git.c\n@@ -142,14 +142,14 @@ static int split_cmdline(char *cmdline, const char ***arg\n\n static int handle_alias(int *argcp, const char ***argv)\n {\n-       int nongit = 0, envchanged = 0, ret = 0, saved_errno = errno;\n+       int envchanged = 0, ret = 0, saved_errno = errno;\n        const char *subdir;\n        int count, option_count;\n        const char** new_argv;\n        const char *alias_command;\n        char *alias_string;\n\n-       subdir = setup_git_directory_gently(&nongit);\n+       subdir = setup_git_directory_gently(NULL);\n\n        alias_command = (*argv)[0];\n        alias_string = alias_lookup(alias_command);\n\n\nof the commit you mentioned is utterly wrong.\n\nCiao,\nDscho\n"},{"id":"73477","messageId":"7v1w5qkx2j.fsf@gitster.siamese.dyndns.org","threadId":"12933","inReplyTo":"8aa486160803310819r3a905bbeg5f993a55aaf6efbf@mail.gmail.com","subject":"Re: [BUG] aliases not working outside of a working copy","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-01T04:39:48Z","receivedAt":"2008-04-01T04:39:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Santi Béjar\" <sbejar@gmail.com> writes:\n\n>   I use the following alias:\n>\n> [alias]\n>         wdiff = diff --color-words\n>\n> and it no longer works outside of a working copy since:\n>\n> af05d67 (Always set *nongit_ok in setup_git_directory_gently())\n>\n> The problem is with the alias system that detects if you are in a\n> working copy, not with the command, as the\n> command just works fine.\n\nI was wondering if anybody was using git alias outside git repository, as\nI thought such a use would be somewhat unorthodox.  The easter egg took 6\ndays to get discovered.\n\nI'll commit this on 'master'.  Thanks for satisfying my curiosity ;-)\n\n-- >8 --\n[PATCH] Accept git aliases outside a git repository\n\naf05d67 (Always set *nongit_ok in setup_git_directory_gently(),\n2008-03-25) had a change from the patch originally submitted that resulted\nin disabling aliases outside a git repository.\n\nIt turns out that some people used \"alias.fubar = diff --color-words\" in\n$HOME/.gitconfig to use non-git command outside git repositories, and this\nchange broke such a usage, so this resurrects the support.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git.c |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex b7729d7..c4e4644 100644\n--- a/git.c\n+++ b/git.c\n@@ -148,8 +148,9 @@ static int handle_alias(int *argcp, const char ***argv)\n \tconst char** new_argv;\n \tconst char *alias_command;\n \tchar *alias_string;\n+\tint unused_nongit;\n \n-\tsubdir = setup_git_directory_gently(NULL);\n+\tsubdir = setup_git_directory_gently(&unused_nongit);\n \n \talias_command = (*argv)[0];\n \talias_string = alias_lookup(alias_command);\n-- \n1.5.5.rc2.155.gb0a67\n"},{"id":"73488","messageId":"8aa486160804010104u62a45081taa25693b690150c6@mail.gmail.com","threadId":"12933","inReplyTo":"7v1w5qkx2j.fsf@gitster.siamese.dyndns.org","subject":"Re: [BUG] aliases not working outside of a working copy","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-04-01T08:04:06Z","receivedAt":"2008-04-01T08:04:06Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Tue, Apr 1, 2008 at 6:39 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>  I was wondering if anybody was using git alias outside git repository, as\n>  I thought such a use would be somewhat unorthodox.  The easter egg took 6\n>  days to get discovered.\n>\n>  I'll commit this on 'master'.  Thanks for satisfying my curiosity ;-)\n\nYou're welcome.\n\nSanti\n"}]}