{"thread":{"id":"23993","subject":"Aliasing with parameters doesn't seem to work properly in git 1.7.0.5","startedAt":"2010-06-03T14:52:39Z","lastAt":"2010-06-03T15:15:35Z","messageCount":4,"participants":["Eugene Sajine","Jacob Helwig","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"142892","messageId":"AANLkTilEZknW7m0n3y8SX5oAaZiUTorgqfX3jTB8mnDC@mail.gmail.com","threadId":"23993","inReplyTo":null,"subject":"Aliasing with parameters doesn't seem to work properly in git 1.7.0.5","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-06-03T14:52:39Z","receivedAt":"2010-06-03T14:52:39Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Hi,\n\ni'm trying to create an alias like this:\n\ncln = !sh -c 'git clone git://server/\"$1\"'\n\nthe idea is to make a shortcut, so instead of command like this:\n\n$git clone git://server/folder/repo.git\n\ni can have something like this:\n\n$git cln folder/repo.git\n\nor even\n$git cln folder/repo\n\nif the alias is like this:\ncln = !sh -c 'git clone git://server/\"$1\".git'\n\nthis doesn't work as it tries to initialize a repo called server.git\nand then fails because \"remote hang up unexpecedly\"\nis there something wrong in expansion of this alias or the alias\nitself is not valid?\n\nAny ideas?\n\nThanks,\nEugene\n"},{"id":"142893","messageId":"AANLkTikWBzHLCQzC57bZQwCB6MxOYS8R5Y-UBZoh_ndS@mail.gmail.com","threadId":"23993","inReplyTo":"AANLkTilEZknW7m0n3y8SX5oAaZiUTorgqfX3jTB8mnDC@mail.gmail.com","subject":"Re: Aliasing with parameters doesn't seem to work properly in git 1.7.0.5","fromName":"Jacob Helwig","fromEmail":"jacob.helwig@gmail.com","sentAt":"2010-06-03T14:55:36Z","receivedAt":"2010-06-03T14:55:36Z","isPatch":false,"sender":{"key":"jacob.helwig@gmail.com","avatar":"https://avatars.githubusercontent.com/u/14557?v=4"},"body":"On Thu, Jun 3, 2010 at 07:52, Eugene Sajine <euguess@gmail.com> wrote:\n> Hi,\n>\n> i'm trying to create an alias like this:\n>\n> cln = !sh -c 'git clone git://server/\"$1\"'\n>\n> the idea is to make a shortcut, so instead of command like this:\n>\n> $git clone git://server/folder/repo.git\n>\n> i can have something like this:\n>\n> $git cln folder/repo.git\n>\n> or even\n> $git cln folder/repo\n>\n> if the alias is like this:\n> cln = !sh -c 'git clone git://server/\"$1\".git'\n>\n> this doesn't work as it tries to initialize a repo called server.git\n> and then fails because \"remote hang up unexpecedly\"\n> is there something wrong in expansion of this alias or the alias\n> itself is not valid?\n>\n> Any ideas?\n>\n> Thanks,\n> Eugene\n\n\nYou need \" -\" at the end of your alias for the parameters to get through.\n\nTry using:\n\ncln = !sh -c 'git clone git://server/\"$1\"' -\n\nor\n\ncln = !sh -c 'git clone git://server/\"$1\".git' -\n"},{"id":"142895","messageId":"AANLkTilcESWIptCX3ZIVTrdI9JcC4XrHp9KTjR-jqzj7@mail.gmail.com","threadId":"23993","inReplyTo":"AANLkTilEZknW7m0n3y8SX5oAaZiUTorgqfX3jTB8mnDC@mail.gmail.com","subject":"Re: Aliasing with parameters doesn't seem to work properly in git 1.7.0.5","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2010-06-03T15:04:03Z","receivedAt":"2010-06-03T15:04:03Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Thu, Jun 3, 2010 at 4:52 PM, Eugene Sajine <euguess@gmail.com> wrote:\n[...]\n\n so instead of command like this:\n>\n> $git clone git://server/folder/repo.git\n>\n> i can have something like this:\n>\n> $git cln folder/repo.git\n>\n> or even\n> $git cln folder/repo\n\nThen, you can the url.<url>.insteadof mechanism:\n\n[url \"<actual url base>\"]\n      insteadOf = <other url base>\n\n       For example, with this:\n\n[url \"git://git.host.xz/\"]\n      insteadOf = work:\n\nyou can clone it with: git clone work:project.\n\nSee git-clone and/or git-config man page for more information.\n\nHTH,\nSanti\n"},{"id":"142896","messageId":"AANLkTik0438juR__hD87KJlqRTYOIyCncnwZ0hF1_tDC@mail.gmail.com","threadId":"23993","inReplyTo":"AANLkTikWBzHLCQzC57bZQwCB6MxOYS8R5Y-UBZoh_ndS@mail.gmail.com","subject":"Re: Aliasing with parameters doesn't seem to work properly in git 1.7.0.5","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-06-03T15:15:35Z","receivedAt":"2010-06-03T15:15:35Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Thu, Jun 3, 2010 at 10:55 AM, Jacob Helwig <jacob.helwig@gmail.com> wrote:\n> On Thu, Jun 3, 2010 at 07:52, Eugene Sajine <euguess@gmail.com> wrote:\n>> Hi,\n>>\n>> i'm trying to create an alias like this:\n>>\n>> cln = !sh -c 'git clone git://server/\"$1\"'\n>>\n>> the idea is to make a shortcut, so instead of command like this:\n>>\n>> $git clone git://server/folder/repo.git\n>>\n>> i can have something like this:\n>>\n>> $git cln folder/repo.git\n>>\n>> or even\n>> $git cln folder/repo\n>>\n>> if the alias is like this:\n>> cln = !sh -c 'git clone git://server/\"$1\".git'\n>>\n>> this doesn't work as it tries to initialize a repo called server.git\n>> and then fails because \"remote hang up unexpecedly\"\n>> is there something wrong in expansion of this alias or the alias\n>> itself is not valid?\n>>\n>> Any ideas?\n>>\n>> Thanks,\n>> Eugene\n>\n>\n> You need \" -\" at the end of your alias for the parameters to get through.\n>\n> Try using:\n>\n> cln = !sh -c 'git clone git://server/\"$1\"' -\n>\n> or\n>\n> cln = !sh -c 'git clone git://server/\"$1\".git' -\n>\n\nThis worked - thank you!!\n\nEugene\n"}]}