{"thread":{"id":"31725","subject":"Re: git commit --amen","startedAt":"2012-10-04T14:10:26Z","lastAt":"2012-10-04T17:13:49Z","messageCount":7,"participants":["Phil Hord","Romain Vimont (®om)","Erik Faye-Lund","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"200498","messageId":"0d559e3191a392841124d96870a67735@rom1v.com","threadId":"31725","inReplyTo":null,"subject":"git commit --amen","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-10-04T14:10:26Z","receivedAt":"2012-10-04T14:10:26Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"Hi,\n\nIs it normal that \"git commit --amen\" actually works ?\n(it does like --amend)\n\nversion 1.7.10.4\n\n®om\n"},{"id":"200489","messageId":"CABURp0rbNZSOC_Jtxfjp+j3SQR=+r0pU6vOXvc0Jnth0UU9mDA@mail.gmail.com","threadId":"31725","inReplyTo":"0d559e3191a392841124d96870a67735@rom1v.com","subject":"Re: git commit --amen","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2012-10-04T14:25:50Z","receivedAt":"2012-10-04T14:25:50Z","isPatch":false,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"> Is it normal that \"git commit --amen\" actually works ?\n> (it does like --amend)\n>\n> version 1.7.10.4\n\nYes.  From Documentation/technical/api-parse-options.txt:\n\n    * Long options may be 'abbreviated', as long as the abbreviation\n      is unambiguous.\n\nApparently since 2008-06-22.\n\nSo 'git commit --am' also works.  But it should probably be avoided\nbecause of its similarity to 'git commit -am'.\n\nPhil\n"},{"id":"200524","messageId":"ace0aa63d5e822c6cdd5d9a3d20bd675@rom1v.com","threadId":"31725","inReplyTo":"CABURp0rbNZSOC_Jtxfjp+j3SQR=+r0pU6vOXvc0Jnth0UU9mDA@mail.gmail.com","subject":"Re: git commit --amen","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-10-04T14:38:22Z","receivedAt":"2012-10-04T14:38:22Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"Great !\nThank you for your answer ;-)\n\nIt does not seem to work with git diff:\ngit diff --cache     #missing d\ngit diff --cumulativ #missing e\n\n®om\n\nLe 2012-10-04 16:25, Phil Hord a écrit :\n>> Is it normal that \"git commit --amen\" actually works ?\n>> (it does like --amend)\n>>\n>> version 1.7.10.4\n>\n> Yes.  From Documentation/technical/api-parse-options.txt:\n>\n>     * Long options may be 'abbreviated', as long as the abbreviation\n>       is unambiguous.\n>\n> Apparently since 2008-06-22.\n>\n> So 'git commit --am' also works.  But it should probably be avoided\n> because of its similarity to 'git commit -am'.\n>\n> Phil\n"},{"id":"200516","messageId":"CABPQNSYZkAax1iav_qS=0j8=XNDHPsWH_V4BMkpQi63iLb1rtQ@mail.gmail.com","threadId":"31725","inReplyTo":"ace0aa63d5e822c6cdd5d9a3d20bd675@rom1v.com","subject":"Re: git commit --amen","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-10-04T14:57:03Z","receivedAt":"2012-10-04T14:57:03Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Thu, Oct 4, 2012 at 4:38 PM, Romain Vimont (®om) <rom@rom1v.com> wrote:\n> Great !\n> Thank you for your answer ;-)\n>\n> It does not seem to work with git diff:\n> git diff --cache     #missing d\n> git diff --cumulativ #missing e\n\nThis is because git-diff doesn't yet use the parse-options API, but\ninstead does ad-hoc parsing.\n"},{"id":"200544","messageId":"7va9w218ou.fsf@alter.siamese.dyndns.org","threadId":"31725","inReplyTo":"CABURp0rbNZSOC_Jtxfjp+j3SQR=+r0pU6vOXvc0Jnth0UU9mDA@mail.gmail.com","subject":"Re: git commit --amen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-04T16:52:17Z","receivedAt":"2012-10-04T16:52:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phil Hord <phil.hord@gmail.com> writes:\n\n>> Is it normal that \"git commit --amen\" actually works ?\n>> (it does like --amend)\n>>\n>> version 1.7.10.4\n>\n> Yes.  From Documentation/technical/api-parse-options.txt:\n>\n>     * Long options may be 'abbreviated', as long as the abbreviation\n>       is unambiguous.\n>\n> Apparently since 2008-06-22.\n\nNotice \"technical/api-\" part; that is a _wrong_ documentation page\nto quote to end users.\n\nInstead quote from \"git help cli\".\n\n       From the git 1.5.4 series and further, many git commands (not\n       all of them at the time of the writing though) come with an\n       enhanced option parser.\n\n> So 'git commit --am' also works.  But it should probably be avoided\n> because of its similarity to 'git commit -am'.\n\nYes, in general, you should avoid relying on shortened form\nworking.  Git 2.4 may add an option \"--amen\" that has totally\ndifferent meaning.\n"},{"id":"200546","messageId":"7v626q18o4.fsf@alter.siamese.dyndns.org","threadId":"31725","inReplyTo":"CABPQNSYZkAax1iav_qS=0j8=XNDHPsWH_V4BMkpQi63iLb1rtQ@mail.gmail.com","subject":"Re: git commit --amen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-04T16:52:43Z","receivedAt":"2012-10-04T16:52:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Erik Faye-Lund <kusmabite@gmail.com> writes:\n\n> On Thu, Oct 4, 2012 at 4:38 PM, Romain Vimont (®om) <rom@rom1v.com> wrote:\n>> Great !\n>> Thank you for your answer ;-)\n>>\n>> It does not seem to work with git diff:\n>> git diff --cache     #missing d\n>> git diff --cumulativ #missing e\n>\n> This is because git-diff doesn't yet use the parse-options API,...\n\nThat is more like \"it predates parse-options\".\n"},{"id":"200549","messageId":"7v1uhe17oy.fsf@alter.siamese.dyndns.org","threadId":"31725","inReplyTo":"7va9w218ou.fsf@alter.siamese.dyndns.org","subject":"Re: git commit --amen","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-10-04T17:13:49Z","receivedAt":"2012-10-04T17:13:49Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Phil Hord <phil.hord@gmail.com> writes:\n>\n>>> Is it normal that \"git commit --amen\" actually works ?\n>>> (it does like --amend)\n>>>\n>>> version 1.7.10.4\n>>\n>> Yes.  From Documentation/technical/api-parse-options.txt:\n>>\n>>     * Long options may be 'abbreviated', as long as the abbreviation\n>>       is unambiguous.\n>>\n>> Apparently since 2008-06-22.\n>\n> Notice \"technical/api-\" part; that is a _wrong_ documentation page\n> to quote to end users.\n>\n> Instead quote from \"git help cli\".\n>\n>        From the git 1.5.4 series and further, many git commands (not\n>        all of them at the time of the writing though) come with an\n>        enhanced option parser.\n>\n>> So 'git commit --am' also works.  But it should probably be avoided\n>> because of its similarity to 'git commit -am'.\n>\n> Yes, in general, you should avoid relying on shortened form\n> working.  Git 2.4 may add an option \"--amen\" that has totally\n> different meaning.\n\nPerhaps a patch along this line might not hurt.\n\n Documentation/gitcli.txt | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)\n\ndiff --git i/Documentation/gitcli.txt w/Documentation/gitcli.txt\nindex f6ba90c..3bc1500 100644\n--- i/Documentation/gitcli.txt\n+++ w/Documentation/gitcli.txt\n@@ -93,7 +93,7 @@ ENHANCED OPTION PARSER\n From the git 1.5.4 series and further, many git commands (not all of them at the\n time of the writing though) come with an enhanced option parser.\n \n-Here is an exhaustive list of the facilities provided by this option parser.\n+Here is a list of the facilities provided by this option parser.\n \n \n Magic Options\n@@ -137,6 +137,16 @@ options. This means that you can for example use `git rm -rf` or\n `git clean -fdx`.\n \n \n+Abbreviating long options\n+~~~~~~~~~~~~~~~~~~~~~~~~~\n+Commands that support the enhanced option parser accepts unique\n+prefix of a long option as if it is fully spelled out, but use this\n+with a caution.  For example, `git commit --amen` behaves as if you\n+typed `git commit --amend`, but that is true only until a later version\n+of Git introduces another option that shares the same prefix,\n+e.g `git commit --amenity\" option.\n+\n+\n Separating argument from the option\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n You can write the mandatory option parameter to an option as a separate\n"}]}