Skip to content

Commit 4061494

Browse files
committed
Merge branch 'ar/unconfuse-three-dots' into pu
* ar/unconfuse-three-dots: Documentation: revisions: add note about 3dots usages as continuation indications Documentation: user-manual: limit potentially confusing usage of 3dots (and 2dots) checkout: describe_detached_head: remove 3dots after committish
2 parents 1f41018 + bd49ffe commit 4061494

File tree

3 files changed

+22
-11
lines changed

3 files changed

+22
-11
lines changed

Documentation/revisions.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ The '..' (two-dot) Range Notation::
271271
for commits that are reachable from r2 excluding those that are reachable
272272
from r1 by '{caret}r1 r2' and it can be written as 'r1..r2'.
273273

274-
The '...' (three dot) Symmetric Difference Notation::
274+
The '...' (three-dot) Symmetric Difference Notation::
275275
A similar notation 'r1\...r2' is called symmetric difference
276276
of 'r1' and 'r2' and is defined as
277277
'r1 r2 --not $(git merge-base --all r1 r2)'.
@@ -285,6 +285,15 @@ is a shorthand for 'HEAD..origin' and asks "What did the origin do since
285285
I forked from them?" Note that '..' would mean 'HEAD..HEAD' which is an
286286
empty range that is both reachable and unreachable from HEAD.
287287

288+
However, there are instances where '<sha1>...' is *not*
289+
equivalent to '<sha1>...HEAD'. See the "RAW OUTPUT FORMAT"
290+
section of linkgit:git-diff[1]: the three-dot notations used
291+
there are simply continuation indications for the abbreviated
292+
SHA-1 values. The ones encountered there are usually
293+
associated with file/index/tree contents rather than with commit
294+
objects, and the range operators described above are only
295+
applicable to commit objects (i.e., 'r1' and 'r2').
296+
288297
Other <rev>{caret} Parent Shorthand Notations
289298
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
290299
Three other shorthands exist, particularly useful for merge commits,

Documentation/user-manual.txt

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ do so (now or later) by using -b with the checkout command again. Example:
319319

320320
git checkout -b new_branch_name
321321

322-
HEAD is now at 427abfa... Linux v2.6.17
322+
HEAD is now at 427abfa Linux v2.6.17
323323
------------------------------------------------
324324

325325
The HEAD then refers to the SHA-1 of the commit instead of to a branch,
@@ -508,7 +508,7 @@ Bisecting: 3537 revisions left to test after this
508508

509509
If you run `git branch` at this point, you'll see that Git has
510510
temporarily moved you in "(no branch)". HEAD is now detached from any
511-
branch and points directly to a commit (with commit id 65934...) that
511+
branch and points directly to a commit (with commit id 65934) that
512512
is reachable from "master" but not from v2.6.18. Compile and test it,
513513
and see whether it crashes. Assume it does crash. Then:
514514

@@ -549,14 +549,14 @@ says "bisect". Choose a safe-looking commit nearby, note its commit
549549
id, and check it out with:
550550

551551
-------------------------------------------------
552-
$ git reset --hard fb47ddb2db...
552+
$ git reset --hard fb47ddb2db
553553
-------------------------------------------------
554554

555555
then test, run `bisect good` or `bisect bad` as appropriate, and
556556
continue.
557557

558558
Instead of `git bisect visualize` and then `git reset --hard
559-
fb47ddb2db...`, you might just want to tell Git that you want to skip
559+
fb47ddb2db`, you might just want to tell Git that you want to skip
560560
the current commit:
561561

562562
-------------------------------------------------
@@ -3426,6 +3426,8 @@ Date:
34263426
...
34273427
:100644 100644 oldsha... 4b9458b... M somedirectory/myfile
34283428
------------------------------------------------
3429+
(Note that in the above, the "..." are used as continuation
3430+
indications, not as symmetric difference operators!)
34293431

34303432
This tells you that the immediately following version of the file was
34313433
"newsha", and that the immediately preceding version was "oldsha".
@@ -3449,7 +3451,7 @@ and your repository is good again!
34493451
$ git log --raw --all
34503452
------------------------------------------------
34513453

3452-
and just looked for the sha of the missing object (4b9458b..) in that
3454+
and just looked for the sha of the missing object (4b9458b) in that
34533455
whole thing. It's up to you--Git does *have* a lot of information, it is
34543456
just missing one particular blob version.
34553457

@@ -4114,9 +4116,9 @@ program, e.g. `diff3`, `merge`, or Git's own merge-file, on
41144116
the blob objects from these three stages yourself, like this:
41154117

41164118
------------------------------------------------
4117-
$ git cat-file blob 263414f... >hello.c~1
4118-
$ git cat-file blob 06fa6a2... >hello.c~2
4119-
$ git cat-file blob cc44c73... >hello.c~3
4119+
$ git cat-file blob 263414f >hello.c~1
4120+
$ git cat-file blob 06fa6a2 >hello.c~2
4121+
$ git cat-file blob cc44c73 >hello.c~3
41204122
$ git merge-file hello.c~2 hello.c~1 hello.c~3
41214123
------------------------------------------------
41224124

@@ -4374,7 +4376,7 @@ $ git log --no-merges t/
43744376
------------------------
43754377

43764378
In the pager (`less`), just search for "bundle", go a few lines back,
4377-
and see that it is in commit 18449ab0... Now just copy this object name,
4379+
and see that it is in commit 18449ab0. Now just copy this object name,
43784380
and paste it into the command line
43794381

43804382
-------------------

builtin/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static void describe_detached_head(const char *msg, struct commit *commit)
402402
struct strbuf sb = STRBUF_INIT;
403403
if (!parse_commit(commit))
404404
pp_commit_easy(CMIT_FMT_ONELINE, commit, &sb);
405-
fprintf(stderr, "%s %s... %s\n", msg,
405+
fprintf(stderr, "%s %s %s\n", msg,
406406
find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV), sb.buf);
407407
strbuf_release(&sb);
408408
}

0 commit comments

Comments
 (0)