{"thread":{"id":"33700","subject":"[PATCH v2 0/9] A natural solution to the @ -> HEAD problem","startedAt":"2013-05-02T13:39:25Z","lastAt":"2013-05-02T17:38:56Z","messageCount":24,"participants":["Ramkumar Ramachandra","Eric Sunshine","Felipe Contreras"],"isPatch":true,"patchVersion":2,"patchTotal":9},"messages":[{"id":"216250","messageId":"1367501974-6879-1-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":null,"subject":"[PATCH v2 0/9] A natural solution to the @ -> HEAD problem","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:25Z","receivedAt":"2013-05-02T13:39:25Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nSo, we're back with v2 of the series.  Six patches add comprehensive\ntests to at-combinations, guarding against any future bugs.  [7/9] is\nthe most important part, where I've fixed branch_get() with a long\njustification.  [8/9] and [9/9] are almost trivial.\n\nAs Felipe pointed out, [9/9] might require more documentation, but I\ndon't know where to put it.  Help in the area is appreciated.\n\nI've excluded all @-parsing simplification in this series.  It will\ncome as a later series based on this one: I'm currently integrating\nFelipe's work with mine.\n\nFelipe: can I have your sign-off for the first three parts?\n\nThanks.\n\nFelipe Contreras (3):\n  t1508 (at-combinations): simplify setup\n  t1508 (at-combinations): test branches separately\n  t1508 (at-combinations): improve nonsense()\n\nRamkumar Ramachandra (6):\n  t1508 (at-combinations): increase coverage\n  t1508 (at-combinations): document @{N} versus HEAD@{N}\n  t1508 (at-combinations): test with symbolic refs\n  remote.c: teach branch_get() to treat symrefs other than HEAD\n  sha1_name.c: fix @-parsing bug in interpret_branch_name()\n  refs.c: make @ a pseudo-ref alias to HEAD\n\n Documentation/git-check-ref-format.txt |  2 +\n Documentation/revisions.txt            |  8 +++-\n refs.c                                 | 12 +++++-\n remote.c                               | 23 ++++++++++--\n sha1_name.c                            |  2 +-\n t/t1400-update-ref.sh                  |  3 ++\n t/t1508-at-combinations.sh             | 68 ++++++++++++++++++++++++++--------\n 7 files changed, 94 insertions(+), 24 deletions(-)\n\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216252","messageId":"1367501974-6879-2-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 1/9] t1508 (at-combinations): simplify setup","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:26Z","receivedAt":"2013-05-02T13:39:26Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"From: Felipe Contreras <felipe.contreras@gmail.com>\n\nInstead of setting the configuration variables branch.<name>.merge and\nbranch.<name>.remote by hand, use the shortcut 'git branch -u', which\nis exactly equivalent.  It's much more readable now.\n\n[rr: commit message]\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex d5d6244..46e3f16 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -31,10 +31,8 @@ test_expect_success 'setup' '\n \tgit checkout -b new-branch &&\n \ttest_commit new-one &&\n \ttest_commit new-two &&\n-\tgit config branch.old-branch.remote . &&\n-\tgit config branch.old-branch.merge refs/heads/master &&\n-\tgit config branch.new-branch.remote . &&\n-\tgit config branch.new-branch.merge refs/heads/upstream-branch\n+\tgit branch -u master old-branch &&\n+\tgit branch -u upstream-branch new-branch\n '\n \n check HEAD new-two\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216251","messageId":"1367501974-6879-3-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 2/9] t1508 (at-combinations): test branches separately","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:27Z","receivedAt":"2013-05-02T13:39:27Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"From: Felipe Contreras <felipe.contreras@gmail.com>\n\nIn the tests involving @{-1} and @{u} as the final component, what we\nreally want to check is if it's pointing to the right ref.  We\ncurrently check the tip commit of the ref, but we can clarify this by\nseparating out checking for commits versus checking for refs at\ncheck().\n\n[rr: commit message, fix arguments in check()]\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 27 ++++++++++++++++-----------\n 1 file changed, 16 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex 46e3f16..cacb2d0 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -4,9 +4,14 @@ test_description='test various @{X} syntax combinations together'\n . ./test-lib.sh\n \n check() {\n-test_expect_${3:-success} \"$1 = $2\" \"\n-\techo '$2' >expect &&\n-\tgit log -1 --format=%s '$1' >actual &&\n+test_expect_${4:-success} \"$1 = ${3:-$2}\" \"\n+\tif [ '$2' == 'commit' ]; then\n+\t\techo '$3' >expect &&\n+\t\tgit log -1 --format=%s '$1' >actual\n+\telse\n+\t\techo '${3:-$2}' >expect &&\n+\t\tgit rev-parse --symbolic-full-name '$1' >actual\n+\tfi &&\n \ttest_cmp expect actual\n \"\n }\n@@ -35,14 +40,14 @@ test_expect_success 'setup' '\n \tgit branch -u upstream-branch new-branch\n '\n \n-check HEAD new-two\n-check \"@{1}\" new-one\n-check \"@{-1}\" old-two\n-check \"@{-1}@{1}\" old-one\n-check \"@{u}\" upstream-two\n-check \"@{u}@{1}\" upstream-one\n-check \"@{-1}@{u}\" master-two\n-check \"@{-1}@{u}@{1}\" master-one\n+check HEAD refs/heads/new-branch\n+check \"@{1}\" commit new-one\n+check \"@{-1}\" refs/heads/old-branch\n+check \"@{-1}@{1}\" commit old-one\n+check \"@{u}\" refs/heads/upstream-branch\n+check \"@{u}@{1}\" commit upstream-one\n+check \"@{-1}@{u}\" refs/heads/master\n+check \"@{-1}@{u}@{1}\" commit master-one\n nonsense \"@{u}@{-1}\"\n nonsense \"@{1}@{u}\"\n \n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216256","messageId":"1367501974-6879-4-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 3/9] t1508 (at-combinations): improve nonsense()","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:28Z","receivedAt":"2013-05-02T13:39:28Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"From: Felipe Contreras <felipe.contreras@gmail.com>\n\nnonsense() is checking at the wrong abstraction layer: it doesn't need\nto invoke a 'git log' at all; it is sufficient to check that 'git\nrev-parse' can't resolve the argument.\n\n[rr: commit message, minor modification]\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex cacb2d0..55fdd0f 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -17,7 +17,7 @@ test_expect_${4:-success} \"$1 = ${3:-$2}\" \"\n }\n nonsense() {\n test_expect_${2:-success} \"$1 is nonsensical\" \"\n-\ttest_must_fail git log -1 '$1'\n+\ttest_must_fail git rev-parse '$1'\n \"\n }\n fail() {\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216258","messageId":"1367501974-6879-5-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 4/9] t1508 (at-combinations): increase coverage","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:29Z","receivedAt":"2013-05-02T13:39:29Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Add more tests exercising documented functionality.\n\nIt is worth nothing that HEAD@{-<n>} is senseless because @{-<n>}\ncannot be used with anything other than HEAD anyway.\n\n[fc: contribute a couple of tests]\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex 55fdd0f..eaa5337 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -42,13 +42,21 @@ test_expect_success 'setup' '\n \n check HEAD refs/heads/new-branch\n check \"@{1}\" commit new-one\n+check \"HEAD@{1}\" commit new-one\n+check \"@{now}\" commit new-two\n+check \"HEAD@{now}\" commit new-two\n check \"@{-1}\" refs/heads/old-branch\n+check \"@{-1}@{0}\" commit old-two\n check \"@{-1}@{1}\" commit old-one\n check \"@{u}\" refs/heads/upstream-branch\n+check \"HEAD@{u}\" refs/heads/upstream-branch\n check \"@{u}@{1}\" commit upstream-one\n check \"@{-1}@{u}\" refs/heads/master\n check \"@{-1}@{u}@{1}\" commit master-one\n nonsense \"@{u}@{-1}\"\n+nonsense \"@{0}@{0}\"\n nonsense \"@{1}@{u}\"\n+nonsense \"HEAD@{-1}\"\n+nonsense \"@{-1}@{-1}\"\n \n test_done\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216253","messageId":"1367501974-6879-6-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 5/9] t1508 (at-combinations): document @{N} versus HEAD@{N}","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:30Z","receivedAt":"2013-05-02T13:39:30Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"All the tests so far check that @{N} is the same as HEAD@{N} (for\npositive N).  However, this is not always the case: write a couple of\ntests for this.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex eaa5337..29ffd73 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -59,4 +59,18 @@ nonsense \"@{1}@{u}\"\n nonsense \"HEAD@{-1}\"\n nonsense \"@{-1}@{-1}\"\n \n+# Document differences between @{N} and HEAD@{N}.  The former resolves\n+# HEAD to a branch and looks up the logs for that branch, while the\n+# latter looks for the logs of HEAD.\n+check \"HEAD@{3}\" commit old-two\n+nonsense \"@{3}\"\n+\n+test_expect_success 'switch to old-branch' '\n+\tgit checkout old-branch\n+'\n+\n+check HEAD refs/heads/old-branch\n+check \"HEAD@{1}\" commit new-two\n+check \"@{1}\" commit old-one\n+\n test_done\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216254","messageId":"1367501974-6879-7-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 6/9] t1508 (at-combinations): test with symbolic refs","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:31Z","receivedAt":"2013-05-02T13:39:31Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Symbolic refs don't work with @{u}.  Document this failure.  Also\ncreate a symbolic-ref @ (which is a valid ref name), and test\neverything with it to make sure that there is no bug in the @-parser.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n t/t1508-at-combinations.sh | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex 29ffd73..bb86c79 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -59,6 +59,19 @@ nonsense \"@{1}@{u}\"\n nonsense \"HEAD@{-1}\"\n nonsense \"@{-1}@{-1}\"\n \n+# Symbolic refs\n+git symbolic-ref H HEAD\n+check \"H@{1}\" commit new-one\n+check \"H@{now}\" commit new-two\n+check \"H@{u}\" ref refs/heads/upstream-branch failure\n+\n+# To make sure that the @-parser isn't buggy, check things with the\n+# symbolic-ref @\n+git symbolic-ref @ HEAD\n+check \"@@{1}\" commit new-one\n+check \"@@{now}\" commit new-two\n+check \"@@{u}\" ref refs/heads/upstream-branch failure\n+\n # Document differences between @{N} and HEAD@{N}.  The former resolves\n # HEAD to a branch and looks up the logs for that branch, while the\n # latter looks for the logs of HEAD.\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216255","messageId":"1367501974-6879-8-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 7/9] remote.c: teach branch_get() to treat symrefs other than HEAD","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:32Z","receivedAt":"2013-05-02T13:39:32Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Broadly, there are two ways to resolve a command-line argument.  The\nfirst approach is to treat it as a revision and resolve it using the\nrevision-parsing mechanism get_sha1().  The other approach is to treat\nit as a ref, and use a reduced mechanism like branch_get().\n\nCompare and contrast the implementations of @{N} and @{u} in\nsha1_name.c to see where exactly branch_get() is useful:\n\nIn <...>@{N}, the <...> is passed through dwim_log() which first calls\nsubstitute_branch_name() and then resolve_ref_unsafe() on that.  The\nresolved ref could be any ref (symbolic/ non-symbolic), and not just a\nrefs/heads/* ref (branch).\n\nHowever, in the <...>@{u} case, the <...> can only be a ref/heads/*\nref or a symbolic ref pointing to a refs/heads/* ref.  It uses\nbranch_get() to find the relevant ref.\n\nUnfortunately, branch_get() doesn't call resolve_ref_unsafe() on what\nis passed to it at all.  Instead it hard-codes the special four-letter\nword \"HEAD\" (which is resolved by read_config() which is called\nfirst), and rejects any other symbolic ref.  This is a historical\nmistake because of which some callers of branch_get() suffer.  To put\nit another way, the commands that accept \"HEAD\" (and resolve it into a\nbranch) can benefit from accepting any other symbolic ref that\nresolves to a branch.  For example, the following fail:\n\n    $ git symbolic-ref M refs/heads/master\n    $ git show M@{u}\n    $ git branch -u ram/master M\n\nThis patch fixes branch_get() directly, making these work.\n\nNotice that branch_get() calls read_config(), which in turn\npreemptively calls resolve_ref_unsafe() on \"HEAD\", when the caller\nmight not even be requesting the current branch.  After copying out\ntwo critical tasks that are required for make_remote() to work\nproperly:\n\n    git_config(handle_config, NULL);\n    alias_all_urls();\n\nwe can remove read_config() and call resolve_ref_unsafe() on the\nargument that is passed ourselves.  HEAD is therefore not a special\ncase anymore.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n remote.c                   | 23 ++++++++++++++++++++---\n t/t1508-at-combinations.sh |  2 +-\n 2 files changed, 21 insertions(+), 4 deletions(-)\n\ndiff --git a/remote.c b/remote.c\nindex 68eb99b..3ac302f 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1463,13 +1463,30 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,\n \n struct branch *branch_get(const char *name)\n {\n-\tstruct branch *ret;\n+\tstruct branch *ret = NULL;\n+\n+\t/* Setup */\n+\tgit_config(handle_config, NULL);\n+\talias_all_urls();\n \n-\tread_config();\n \tif (!name || !*name || !strcmp(name, \"HEAD\"))\n-\t\tret = current_branch;\n+\t\tname = \"HEAD\";\n \telse\n \t\tret = make_branch(name, 0);\n+\n+\tif (!ret || !ret->remote_name) {\n+\t\t/* Is this a symbolic-ref like HEAD, pointing to a\n+\t\t * valid branch?\n+\t\t */\n+\t\tconst char *this_ref;\n+\t\tunsigned char sha1[20];\n+\t\tint flag;\n+\n+\t\tthis_ref = resolve_ref_unsafe(name, sha1, 0, &flag);\n+\t\tif (this_ref && (flag & REF_ISSYMREF) &&\n+\t\t\t!prefixcmp(this_ref, \"refs/heads/\"))\n+\t\t\tret = make_branch(this_ref + strlen(\"refs/heads/\"), 0);\n+\t}\n \tif (ret && ret->remote_name) {\n \t\tret->remote = remote_get(ret->remote_name);\n \t\tif (ret->merge_nr) {\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex bb86c79..424caf5 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -63,7 +63,7 @@ nonsense \"@{-1}@{-1}\"\n git symbolic-ref H HEAD\n check \"H@{1}\" commit new-one\n check \"H@{now}\" commit new-two\n-check \"H@{u}\" ref refs/heads/upstream-branch failure\n+check \"H@{u}\" refs/heads/upstream-branch\n \n # To make sure that the @-parser isn't buggy, check things with the\n # symbolic-ref @\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216259","messageId":"1367501974-6879-9-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 8/9] sha1_name.c: fix @-parsing bug in interpret_branch_name()","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:33Z","receivedAt":"2013-05-02T13:39:33Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Symbolic refs work in the general case, but making @ a symbolic-ref\ndoesn't work due to a parsing bug in interpret_branch_name().  Update\nthe function to parse \"@{\", not '@' (since '@' is a valid symbolic\nref).\n\nThis makes a failing test in t1508 (at-combinations) pass.  In other\nwords, you can now do:\n\n    $ git symbolic-ref @ HEAD\n\nAnd expect the following to work:\n\n    $ git rev-parse @@{u}\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n sha1_name.c                | 2 +-\n t/t1508-at-combinations.sh | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1_name.c b/sha1_name.c\nindex 3820f28..850e6d7 100644\n--- a/sha1_name.c\n+++ b/sha1_name.c\n@@ -1019,7 +1019,7 @@ int interpret_branch_name(const char *name, struct strbuf *buf)\n \t\treturn ret - used + len;\n \t}\n \n-\tcp = strchr(name, '@');\n+\tcp = strstr(name, \"@{\");\n \tif (!cp)\n \t\treturn -1;\n \ttmp_len = upstream_mark(cp, namelen - (cp - name));\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex 424caf5..6a69f9e 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -70,7 +70,7 @@ check \"H@{u}\" refs/heads/upstream-branch\n git symbolic-ref @ HEAD\n check \"@@{1}\" commit new-one\n check \"@@{now}\" commit new-two\n-check \"@@{u}\" ref refs/heads/upstream-branch failure\n+check \"@@{u}\" refs/heads/upstream-branch\n \n # Document differences between @{N} and HEAD@{N}.  The former resolves\n # HEAD to a branch and looks up the logs for that branch, while the\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216257","messageId":"1367501974-6879-10-git-send-email-artagnon@gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"[PATCH 9/9] refs.c: make @ a pseudo-ref alias to HEAD","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T13:39:34Z","receivedAt":"2013-05-02T13:39:34Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"First, make sure that check_refname_format() rejects the a refname\nbeginning with a '@'.  Add a test to t1400 (update-ref) demonstrating\nthat update-ref forbids the user from updating a ref named \"@\".\n\nNow, resolve_ref_unsafe() is built to resolve any refs that have a\ncorresponding file inside $GITDIR.  Our \"@\" ref is a special\npseudo-ref and does not have a filesystem counterpart.  So,\nhard-interpret \"@\" as \"HEAD\" and resolve .git/HEAD as usual.  This\nmeans that we can drop the 'git symbolic-ref @ HEAD' line in t1508\n(at-combinations), and everything will continue working as usual.\n\nIf the user does manage to create a '.git/@' unsafely (via\nsymbolic-ref or otherwise), it will be ignored.\n\nIn practice, this means that you will now be able to do:\n\n    $ git show @~1\n    $ git log @^2\n\nAdvertise these features in the tests and documentation.\n\nSigned-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n---\n Documentation/git-check-ref-format.txt |  2 ++\n Documentation/revisions.txt            |  8 ++++++--\n refs.c                                 | 12 ++++++++++--\n t/t1400-update-ref.sh                  |  3 +++\n t/t1508-at-combinations.sh             |  4 +---\n 5 files changed, 22 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-check-ref-format.txt b/Documentation/git-check-ref-format.txt\nindex ec1739a..3de9adc 100644\n--- a/Documentation/git-check-ref-format.txt\n+++ b/Documentation/git-check-ref-format.txt\n@@ -52,6 +52,8 @@ Git imposes the following rules on how references are named:\n \n . They cannot end with a dot `.`.\n \n+. They cannot be the single character `@`.\n+\n . They cannot contain a sequence `@{`.\n \n . They cannot contain a `\\`.\ndiff --git a/Documentation/revisions.txt b/Documentation/revisions.txt\nindex d477b3f..02bfc90 100644\n--- a/Documentation/revisions.txt\n+++ b/Documentation/revisions.txt\n@@ -27,6 +27,10 @@ blobs contained in a commit.\n   When ambiguous, a '<refname>' is disambiguated by taking the\n   first match in the following rules:\n \n+  . '@' is a synonym for 'HEAD'.  An '@' followed by '\\{' has no\n+    relationship to this and means something entirely different (see\n+    below).\n+\n   . If '$GIT_DIR/<refname>' exists, that is what you mean (this is usually\n     useful only for 'HEAD', 'FETCH_HEAD', 'ORIG_HEAD', 'MERGE_HEAD'\n     and 'CHERRY_PICK_HEAD');\n@@ -93,7 +97,7 @@ some output processing may assume ref names in UTF-8.\n   refers to the branch that the branch specified by branchname is set to build on\n   top of.  A missing branchname defaults to the current one.\n \n-'<rev>{caret}', e.g. 'HEAD{caret}, v1.5.1{caret}0'::\n+'<rev>{caret}', e.g. '@{caret}2', 'HEAD{caret}', 'v1.5.1{caret}0'::\n   A suffix '{caret}' to a revision parameter means the first parent of\n   that commit object.  '{caret}<n>' means the <n>th parent (i.e.\n   '<rev>{caret}'\n@@ -101,7 +105,7 @@ some output processing may assume ref names in UTF-8.\n   '<rev>{caret}0' means the commit itself and is used when '<rev>' is the\n   object name of a tag object that refers to a commit object.\n \n-'<rev>{tilde}<n>', e.g. 'master{tilde}3'::\n+'<rev>{tilde}<n>', e.g. '@{tilde}1', 'master{tilde}3'::\n   A suffix '{tilde}<n>' to a revision parameter means the commit\n   object that is the <n>th generation ancestor of the named\n   commit object, following only the first parents.  I.e. '<rev>{tilde}3' is\ndiff --git a/refs.c b/refs.c\nindex de2d8eb..6a75f77 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -72,6 +72,9 @@ int check_refname_format(const char *refname, int flags)\n {\n \tint component_len, component_count = 0;\n \n+\tif (!strcmp(refname, \"@\"))\n+\t\treturn -1;\n+\n \twhile (1) {\n \t\t/* We are at the start of a path component. */\n \t\tcomponent_len = check_refname_component(refname, flags);\n@@ -1093,8 +1096,13 @@ const char *resolve_ref_unsafe(const char *refname, unsigned char *sha1, int rea\n \tif (flag)\n \t\t*flag = 0;\n \n-\tif (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL))\n-\t\treturn NULL;\n+\tif (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL) < 0) {\n+\t\t/* Handle the pseudo-ref @ */\n+\t\tif (!strcmp(refname, \"@\"))\n+\t\t\trefname = \"HEAD\";\n+\t\telse\n+\t\t\treturn NULL;\n+\t}\n \n \tfor (;;) {\n \t\tchar path[PATH_MAX];\ndiff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh\nindex e415ee0..ee93979 100755\n--- a/t/t1400-update-ref.sh\n+++ b/t/t1400-update-ref.sh\n@@ -127,6 +127,9 @@ test_expect_success '(not) change HEAD with wrong SHA1' \"\n test_expect_success \"(not) changed .git/$m\" \"\n \t! test $B\"' = $(cat .git/'\"$m\"')\n '\n+test_expect_success 'disallow creating a ref with name @' '\n+\ttest_must_fail git update-ref @ HEAD\n+'\n rm -f .git/$m\n \n : a repository with working tree always has reflog these days...\ndiff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\nindex 6a69f9e..c50c3f7 100755\n--- a/t/t1508-at-combinations.sh\n+++ b/t/t1508-at-combinations.sh\n@@ -65,9 +65,7 @@ check \"H@{1}\" commit new-one\n check \"H@{now}\" commit new-two\n check \"H@{u}\" refs/heads/upstream-branch\n \n-# To make sure that the @-parser isn't buggy, check things with the\n-# symbolic-ref @\n-git symbolic-ref @ HEAD\n+# Check everything with pseudo-ref @\n check \"@@{1}\" commit new-one\n check \"@@{now}\" commit new-two\n check \"@@{u}\" refs/heads/upstream-branch\n-- \n1.8.3.rc0.40.g09a0447\n"},{"id":"216261","messageId":"CAPig+cQegm8PsskaWJ4F4+jz3mmwaQEhx5FAfatnLU3ar-FMAw@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-5-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 4/9] t1508 (at-combinations): increase coverage","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2013-05-02T14:26:02Z","receivedAt":"2013-05-02T14:26:02Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Thu, May 2, 2013 at 9:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Add more tests exercising documented functionality.\n>\n> It is worth nothing that HEAD@{-<n>} is senseless because @{-<n>}\n\ns/nothing/noting/\n\n> cannot be used with anything other than HEAD anyway.\n>\n> [fc: contribute a couple of tests]\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n"},{"id":"216262","messageId":"CALkWK0=FbbCferG+q4qymvsm-t_rfSBRZfp7t3kO=z-EF5QYuA@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-8-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 7/9] remote.c: teach branch_get() to treat symrefs other than HEAD","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T14:37:09Z","receivedAt":"2013-05-02T14:37:09Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n> [...]\n\nSo sorry about this, but this breaks some tests in t1507\n(rev-parse-upstream).  I'm looking into this now.\n\nIn the meantime, reviewers can focus on the commit message.\n"},{"id":"216267","messageId":"CALkWK0=eC2M6b5Dh9kR8TZEXRGYnYQtrpb5PUed4nDSStOCTpw@mail.gmail.com","threadId":"33700","inReplyTo":"CALkWK0=FbbCferG+q4qymvsm-t_rfSBRZfp7t3kO=z-EF5QYuA@mail.gmail.com","subject":"Re: [PATCH 7/9] remote.c: teach branch_get() to treat symrefs other than HEAD","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T15:43:49Z","receivedAt":"2013-05-02T15:43:49Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n> So sorry about this, but this breaks some tests in t1507\n> (rev-parse-upstream).  I'm looking into this now.\n>\n> In the meantime, reviewers can focus on the commit message.\n\nSo, it turns out that some callers expect it to read_config().\n\nIf we're still adamant about not touching branch_get(), the\nalternative is to call resolve_ref_unsafe() before the branch_get()\ncall in interpret_branch_name().  We'll still retain the H@{u}, but\nwe'll lose the 'git branch -u ram/master M'.\n"},{"id":"216276","messageId":"CAMP44s2j3TD67NX=OF5Qit7=_gi_cgyBrwuakLU4jwQvOhkFzA@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-8-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 7/9] remote.c: teach branch_get() to treat symrefs other than HEAD","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T16:57:17Z","receivedAt":"2013-05-02T16:57:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 8:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n\n>     $ git symbolic-ref M refs/heads/master\n>     $ git show M@{u}\n>     $ git branch -u ram/master M\n>\n> This patch fixes branch_get() directly, making these work.\n\nIt's not a fix, it's implementing brand new functionality, and\nchanging old behaviors.\n\n> --- a/remote.c\n> +++ b/remote.c\n> @@ -1463,13 +1463,30 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,\n>\n>  struct branch *branch_get(const char *name)\n>  {\n> -       struct branch *ret;\n> +       struct branch *ret = NULL;\n> +\n> +       /* Setup */\n\nI thought the preferred style for these kinds of comments was:\n\n  /* setup */\n\n> +       git_config(handle_config, NULL);\n> +       alias_all_urls();\n>\n> -       read_config();\n>         if (!name || !*name || !strcmp(name, \"HEAD\"))\n\nI still see \"HEAD\" there. Didn't you say your patch makes \"HEAD\" less\nof a special ref? Why is it still here?\n\n> -               ret = current_branch;\n> +               name = \"HEAD\";\n>         else\n>                 ret = make_branch(name, 0);\n> +\n> +       if (!ret || !ret->remote_name) {\n> +               /* Is this a symbolic-ref like HEAD, pointing to a\n> +                * valid branch?\n> +                */\n\nThe style is:\n\n  /*\n   * This is the preferred style for multi-line\n   * comments in the Linux kernel source code.\n   * Please use it consistently.\n   *\n   * Description:  A column of asterisks on the left side,\n   * with beginning and ending almost-blank lines.\n   */\n\n-- \nFelipe Contreras\n"},{"id":"216282","messageId":"CALkWK0=osd8jQYfHcwO8=C_sMNgPj59Th=+tpfZfp7FeopMDyg@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-1-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH v2 0/9] A natural solution to the @ -> HEAD problem","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T17:18:58Z","receivedAt":"2013-05-02T17:18:58Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Ramkumar Ramachandra wrote:\n> Felipe Contreras (3):\n>   t1508 (at-combinations): simplify setup\n>   t1508 (at-combinations): test branches separately\n>   t1508 (at-combinations): improve nonsense()\n>\n> Ramkumar Ramachandra (6):\n>   t1508 (at-combinations): increase coverage\n>   t1508 (at-combinations): document @{N} versus HEAD@{N}\n>   t1508 (at-combinations): test with symbolic refs\n\nCan we just okay these six now, and drop the rest?\n\nThanks.\n"},{"id":"216283","messageId":"CAMP44s3up_xo=oU+5EajoFo7VzA3RDK+hR-maxN9cUw7y=b3Eg@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-3-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 2/9] t1508 (at-combinations): test branches separately","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T17:23:49Z","receivedAt":"2013-05-02T17:23:49Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 8:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> From: Felipe Contreras <felipe.contreras@gmail.com>\n>\n> In the tests involving @{-1} and @{u} as the final component, what we\n> really want to check is if it's pointing to the right ref.  We\n> currently check the tip commit of the ref, but we can clarify this by\n> separating out checking for commits versus checking for refs at\n> check().\n>\n> [rr: commit message, fix arguments in check()]\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  t/t1508-at-combinations.sh | 27 ++++++++++++++++-----------\n>  1 file changed, 16 insertions(+), 11 deletions(-)\n>\n> diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\n> index 46e3f16..cacb2d0 100755\n> --- a/t/t1508-at-combinations.sh\n> +++ b/t/t1508-at-combinations.sh\n> @@ -4,9 +4,14 @@ test_description='test various @{X} syntax combinations together'\n>  . ./test-lib.sh\n>\n>  check() {\n> -test_expect_${3:-success} \"$1 = $2\" \"\n> -       echo '$2' >expect &&\n> -       git log -1 --format=%s '$1' >actual &&\n> +test_expect_${4:-success} \"$1 = ${3:-$2}\" \"\n> +       if [ '$2' == 'commit' ]; then\n> +               echo '$3' >expect &&\n> +               git log -1 --format=%s '$1' >actual\n> +       else\n> +               echo '${3:-$2}' >expect &&\n> +               git rev-parse --symbolic-full-name '$1' >actual\n> +       fi &&\n>         test_cmp expect actual\n>  \"\n>  }\n\nI'm not sure about this. If we introduce a check that fails, we would\nhave to do:\n\ncheck HEAD refs/heads/new-branch \"\" failure\n\nWhich doesn't seem clean. Perhaps it makes more sense to always add\nthe type of check:\n\ncheck HEAD ref refs/heads/new-branch\n\n-- \nFelipe Contreras\n"},{"id":"216284","messageId":"CAMP44s2M0A_ecfFfD_9hYQUvHSXMup6Whpn80rs741Lu1-ytcg@mail.gmail.com","threadId":"33700","inReplyTo":"CALkWK0=osd8jQYfHcwO8=C_sMNgPj59Th=+tpfZfp7FeopMDyg@mail.gmail.com","subject":"Re: [PATCH v2 0/9] A natural solution to the @ -> HEAD problem","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T17:25:40Z","receivedAt":"2013-05-02T17:25:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 12:18 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Ramkumar Ramachandra wrote:\n>> Felipe Contreras (3):\n>>   t1508 (at-combinations): simplify setup\n>>   t1508 (at-combinations): test branches separately\n>>   t1508 (at-combinations): improve nonsense()\n>>\n>> Ramkumar Ramachandra (6):\n>>   t1508 (at-combinations): increase coverage\n>>   t1508 (at-combinations): document @{N} versus HEAD@{N}\n>>   t1508 (at-combinations): test with symbolic refs\n>\n> Can we just okay these six now, and drop the rest?\n\nI'm generally OK with them, but the one for 'symbolic refs' is relying\non a symbolic ref named '@', so it would immediately conflict with my\npatch series.\n\n-- \nFelipe Contreras\n"},{"id":"216285","messageId":"CAMP44s1Hkff1QU7undZvLfFOCeeiBrB4RRtVEOoNCsfoGZu7yg@mail.gmail.com","threadId":"33700","inReplyTo":"1367501974-6879-6-git-send-email-artagnon@gmail.com","subject":"Re: [PATCH 5/9] t1508 (at-combinations): document @{N} versus HEAD@{N}","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T17:27:57Z","receivedAt":"2013-05-02T17:27:57Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 8:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> All the tests so far check that @{N} is the same as HEAD@{N} (for\n> positive N).  However, this is not always the case: write a couple of\n> tests for this.\n>\n> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>\n> ---\n>  t/t1508-at-combinations.sh | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>\n> diff --git a/t/t1508-at-combinations.sh b/t/t1508-at-combinations.sh\n> index eaa5337..29ffd73 100755\n> --- a/t/t1508-at-combinations.sh\n> +++ b/t/t1508-at-combinations.sh\n> @@ -59,4 +59,18 @@ nonsense \"@{1}@{u}\"\n>  nonsense \"HEAD@{-1}\"\n>  nonsense \"@{-1}@{-1}\"\n>\n> +# Document differences between @{N} and HEAD@{N}.\n\nThat's enough explanation, except that we not documenting them, we are\ntesting them.\n\n> The former resolves\n> +# HEAD to a branch and looks up the logs for that branch, while the\n> +# latter looks for the logs of HEAD.\n> +check \"HEAD@{3}\" commit old-two\n> +nonsense \"@{3}\"\n\n> +test_expect_success 'switch to old-branch' '\n> +       git checkout old-branch\n> +'\n> +\n> +check HEAD refs/heads/old-branch\n> +check \"HEAD@{1}\" commit new-two\n> +check \"@{1}\" commit old-one\n\nAnd here we are testing something completely different.\n\n-- \nFelipe Contreras\n"},{"id":"216286","messageId":"CALkWK0=_zcO8K75YxmQVp9hog0yHJ_vH5QKRwpWN8QMUc2zm_Q@mail.gmail.com","threadId":"33700","inReplyTo":"CAMP44s3up_xo=oU+5EajoFo7VzA3RDK+hR-maxN9cUw7y=b3Eg@mail.gmail.com","subject":"Re: [PATCH 2/9] t1508 (at-combinations): test branches separately","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T17:28:25Z","receivedAt":"2013-05-02T17:28:25Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n> I'm not sure about this. If we introduce a check that fails, we would\n> have to do:\n>\n> check HEAD refs/heads/new-branch \"\" failure\n>\n> Which doesn't seem clean. Perhaps it makes more sense to always add\n> the type of check:\n>\n> check HEAD ref refs/heads/new-branch\n\nI think you misunderstood.  Failure looks like this:\n\n    check \"@@{u}\" ref refs/heads/upstream-branch failure\n\nAnd corresponding success like this:\n\n    check \"@@{u}\" refs/heads/upstream-branch\n\nWe can make the \"ref\" compulsory if you like.  I thought about it too.\n"},{"id":"216288","messageId":"CALkWK0n9dOrn_whASyWnx49zwNZV_z-4mstyorN1DTSfKpzfsg@mail.gmail.com","threadId":"33700","inReplyTo":"CAMP44s1Hkff1QU7undZvLfFOCeeiBrB4RRtVEOoNCsfoGZu7yg@mail.gmail.com","subject":"Re: [PATCH 5/9] t1508 (at-combinations): document @{N} versus HEAD@{N}","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T17:30:14Z","receivedAt":"2013-05-02T17:30:14Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n>> +test_expect_success 'switch to old-branch' '\n>> +       git checkout old-branch\n>> +'\n>> +\n>> +check HEAD refs/heads/old-branch\n>> +check \"HEAD@{1}\" commit new-two\n>> +check \"@{1}\" commit old-one\n>\n> And here we are testing something completely different.\n\nHow?  I'm showing that HEAD@{1} can be different from @{1}.\n"},{"id":"216287","messageId":"CAMP44s1wv4sCQM6V3S2+56KnxPJVQAp1skiUP+vSEetmenB_+A@mail.gmail.com","threadId":"33700","inReplyTo":"CALkWK0=_zcO8K75YxmQVp9hog0yHJ_vH5QKRwpWN8QMUc2zm_Q@mail.gmail.com","subject":"Re: [PATCH 2/9] t1508 (at-combinations): test branches separately","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T17:30:37Z","receivedAt":"2013-05-02T17:30:37Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 12:28 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Felipe Contreras wrote:\n>> I'm not sure about this. If we introduce a check that fails, we would\n>> have to do:\n>>\n>> check HEAD refs/heads/new-branch \"\" failure\n>>\n>> Which doesn't seem clean. Perhaps it makes more sense to always add\n>> the type of check:\n>>\n>> check HEAD ref refs/heads/new-branch\n>\n> I think you misunderstood.  Failure looks like this:\n>\n>     check \"@@{u}\" ref refs/heads/upstream-branch failure\n>\n> And corresponding success like this:\n>\n>     check \"@@{u}\" refs/heads/upstream-branch\n>\n> We can make the \"ref\" compulsory if you like.  I thought about it too.\n\nI think it's less surprising.\n\n-- \nFelipe Contreras\n"},{"id":"216291","messageId":"CALkWK0=Ok7=Ef0tPTWJi1uMPGqJS1ao44w6ArxE5d3sVOP_PXw@mail.gmail.com","threadId":"33700","inReplyTo":"CAMP44s2M0A_ecfFfD_9hYQUvHSXMup6Whpn80rs741Lu1-ytcg@mail.gmail.com","subject":"Re: [PATCH v2 0/9] A natural solution to the @ -> HEAD problem","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T17:34:51Z","receivedAt":"2013-05-02T17:34:51Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n> I'm generally OK with them, but the one for 'symbolic refs' is relying\n> on a symbolic ref named '@', so it would immediately conflict with my\n> patch series.\n\nRight.  I'll re-roll when we've finished with the rest.\n"},{"id":"216290","messageId":"CAMP44s1akBT3ZqD5iODjm-AXRMwqsz7K4HCdR5uz07YCLs54yQ@mail.gmail.com","threadId":"33700","inReplyTo":"CALkWK0n9dOrn_whASyWnx49zwNZV_z-4mstyorN1DTSfKpzfsg@mail.gmail.com","subject":"Re: [PATCH 5/9] t1508 (at-combinations): document @{N} versus HEAD@{N}","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-05-02T17:34:59Z","receivedAt":"2013-05-02T17:34:59Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Thu, May 2, 2013 at 12:30 PM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Felipe Contreras wrote:\n>>> +test_expect_success 'switch to old-branch' '\n>>> +       git checkout old-branch\n>>> +'\n>>> +\n>>> +check HEAD refs/heads/old-branch\n>>> +check \"HEAD@{1}\" commit new-two\n>>> +check \"@{1}\" commit old-one\n>>\n>> And here we are testing something completely different.\n>\n> How?  I'm showing that HEAD@{1} can be different from @{1}.\n\nNever mind, I thought you were testing detached HEAD checkouts.\n\n-- \nFelipe Contreras\n"},{"id":"216292","messageId":"CALkWK0kTB+QMbrfpCi8=tJ_wePycSp7MvV6quUJxn0Sdj5jDEw@mail.gmail.com","threadId":"33700","inReplyTo":"CAMP44s1Hkff1QU7undZvLfFOCeeiBrB4RRtVEOoNCsfoGZu7yg@mail.gmail.com","subject":"Re: [PATCH 5/9] t1508 (at-combinations): document @{N} versus HEAD@{N}","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-05-02T17:38:56Z","receivedAt":"2013-05-02T17:38:56Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Felipe Contreras wrote:\n>> +# Document differences between @{N} and HEAD@{N}.\n>\n> That's enough explanation, except that we not documenting them, we are\n> testing them.\n\nThe difference is subtle, and I couldn't find this documented clearly\nanywhere else.  If someone comes asking what the difference is, just\npoint to this comment along with the tests.\n"}]}