{"thread":{"id":"22239","subject":"[PATCH] Documentation: explain how to write aliases that use other aliases","startedAt":"2010-01-16T01:42:34Z","lastAt":"2010-01-16T01:42:34Z","messageCount":1,"participants":["Eric James Michael Ritz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"131842","messageId":"4B51198A.3010504@cybersprocket.com","threadId":"22239","inReplyTo":null,"subject":"[PATCH] Documentation: explain how to write aliases that use other aliases","fromName":"Eric James Michael Ritz","fromEmail":"eric@cybersprocket.com","sentAt":"2010-01-16T01:42:34Z","receivedAt":"2010-01-16T01:42:34Z","isPatch":true,"sender":{"key":"eric@cybersprocket.com","avatar":"https://gravatar.com/avatar/b2211d0a2fc3f3f4b458f9e389233af703452fb0c2d1563ace146bb668ae1455?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nUsers who try to define aliases in terms of other aliases will receive\nan error about an unrecognized command.  This is because Git only\napplies alias expansion once.  However, users can write aliases with\nthe exclamation point prefix to achieve this effect.  Teach users how\nto do this by building off the example of using aliases to call shell\ncommands.\n\nSigned-off-by: Eric James Michael Ritz <Eric@cybersprocket.com>\n- ---\nI ran into this issue try to define some aliases, and then after an\nhour of hacking on alias.c a light-bulb went off in my head, and I\nrealized I could just use the '!' prefix to write aliases that call\nother aliases.  Much simplier than the alias code I was changing, lol.\nSo I thought it would be useful to mention this in the manual, for\nusers like myself who like to build aliases from other aliases.\n\n Documentation/config.txt |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 8acb613..0874a0d 100644\n- --- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -524,7 +524,12 @@ If the alias expansion is prefixed with an exclamation point,\n it will be treated as a shell command.  For example, defining\n \"alias.new = !gitk --all --not ORIG_HEAD\", the invocation\n \"git new\" is equivalent to running the shell command\n- -\"gitk --all --not ORIG_HEAD\".  Note that shell commands will be\n+\"gitk --all --not ORIG_HEAD\".  Git will not expand aliases which\n+call other aliases,  but you can use the exclamation point prefix to\n+achieve this effect.  For example, defining \"alias.today =\n+!git new --since=yesterday\" will cause \"git today\"\n+to expand to \"gitk --all --not ORIG_HEAD --since=yesterday\".\n+Note that shell commands will be\n executed from the top-level directory of a repository, which may\n not necessarily be the current directory.\n\n- --\n1.6.6.159.g8802c\n\n\n\n- -- \nEric Ritz\nCyber Sprocket Labs\n(843) 225-3830\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.9 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niQEcBAEBAgAGBQJLURmKAAoJEEHUZXw5hMWsCZoIALh+tvIJHNVVQtPr1xOEtuYg\nfGh4GUdDOwzsWekbxoUpzFwaE0zteawIlG7QYrLKkuFtR4E3bziM86HpIZ4nIy8b\nwnZzFVSEGfhAIkhxICsSWFDZp1R0tUN5+i5NOhIrMC0nnQ0aM36Ruzyt1GbntkH1\nuBsO9NYpoP+a4HQRGtafXNg2jBC1PoWy3UWTpETsIUHlV3CTrAr17uVbSDt0QSK+\nlfhD717w88mvfewJaNwqnrXskADmE+bYbQBr2dvUAutbcRKx0+HREz3ju+/oTtfN\nnGaSOX/kLUfTIR4+aGz6u2bkfaGt8WDBibGnC1d0l/c9jxvlodOBZxWcFscxZ4A=\n=Divy\n-----END PGP SIGNATURE-----\n"}]}