Skip to contentSkip to conversation

user-manual: add a "counting commits" example

PATCH In review Frank Lichtenheld 3 participants 5 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

Review

Quoted 6 lines · J. Bruce Fields
(quoted diff) +6 -0
+Suppose you want to know how many commits you've made on "mybranch"
+since it diverged from "origin":
+
+-------------------------------------------------
+$ git log --pretty=oneline origin..maint | wc -l
+-------------------------------------------------

Shouldn't that be mybranch instead of maint?

Review

Quoted 7 lines
(quoted diff) +7 -0
+Alternatively you may often see this sort of thing done with the
+lower-level command gitlink:git-rev-list[1], which just lists the SHA1's
+of all the given commits:
+
+-------------------------------------------------
+$ git rev-list origin..maint | wc -l
+-------------------------------------------------

Same here.

Gruesse,

Signature · 2 lines
Frank Lichtenheld <[email protected]>
www: http://www.djpig.de/
#1 lore raw
Quoted 10 lines · Frank Lichtenheld

Review

Quoted 6 lines · J. Bruce Fields
(quoted diff) +6 -0
+Suppose you want to know how many commits you've made on "mybranch"
+since it diverged from "origin":
+
+-------------------------------------------------
+$ git log --pretty=oneline origin..maint | wc -l
+-------------------------------------------------

Shouldn't that be mybranch instead of maint?

Quoted 9 lines

Review

Quoted 7 lines
(quoted diff) +7 -0
+Alternatively you may often see this sort of thing done with the
+lower-level command gitlink:git-rev-list[1], which just lists the SHA1's
+of all the given commits:
+
+-------------------------------------------------
+$ git rev-list origin..maint | wc -l
+-------------------------------------------------

Same here.

Yep, thanks for the sharp eyes.

--b.

#2 lore raw

PATCH 1/1 user-manual: fix branch names in examples

Thanks to Frank Lichtenheld for pointing out inconsistent use of branch names in a couple examples.

Add a little more example output while I'm at it.

At some point actually it might be good for someone to figure out a good example to use consistently throughout the manual and tutorials; it might make them a little easier to read.

---
 Documentation/user-manual.txt |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)
Documentation/user-manual.txt +11 -7
index 9fc2bba..5fb86f2 100644
@@ -701,7 +701,7 @@ Suppose you want to know how many commits you've made on "mybranch"
 since it diverged from "origin":
 
 -------------------------------------------------
-$ git log --pretty=oneline origin..maint | wc -l
+$ git log --pretty=oneline origin..mybranch | wc -l
 -------------------------------------------------
 
 Alternatively you may often see this sort of thing done with the
@@ -709,7 +709,7 @@ lower-level command gitlink:git-rev-list[1], which just lists the SHA1's
 of all the given commits:
 
 -------------------------------------------------
-$ git rev-list origin..maint | wc -l
+$ git rev-list origin..mybranch | wc -l
 -------------------------------------------------
 
 [[checking-for-equal-branches]]
@@ -849,19 +849,23 @@ a07157ac624b2524a059a3414e99f6f44bebc1e7 refs/heads/master
 1e87486ae06626c2f31eaa63d26fc0fd646c8af2 refs/heads/tutorial-fixes
 -------------------------------------------------
 
-We can get just the branch-head names, and remove "maint", with
+We can get just the branch-head names, and remove "master", with
 the help of the standard utilities cut and grep:
 
 -------------------------------------------------
-$ git show-ref --heads | cut -d' ' -f2 | grep -v '^refs/heads/maint'
+$ git show-ref --heads | cut -d' ' -f2 | grep -v '^refs/heads/master'
+refs/heads/core-tutorial
+refs/heads/maint
+refs/heads/tutorial-2
+refs/heads/tutorial-fixes
 -------------------------------------------------
 
-And then we can ask to see all the commits reachable from maint
+And then we can ask to see all the commits reachable from master
 but not from these other heads:
 
 -------------------------------------------------
-$ gitk maint --not $( git show-ref --heads | cut -d' ' -f2 |
-				grep -v '^refs/heads/maint' )
+$ gitk master --not $( git show-ref --heads | cut -d' ' -f2 |
+				grep -v '^refs/heads/master' )
 -------------------------------------------------
 
 Obviously endless variations are possible; to see all commits
Signature · 1 line
1.5.1.4.19.g69e2
#3 lore raw

Re: [PATCH] user-manual: fix branch names in examples

Quoted 5 lines · J. Bruce Fields

Thanks to Frank Lichtenheld for pointing out inconsistent use of branch names in a couple examples.

Add a little more example output while I'm at it.
...

Thanks everybody for participating in these fixups.

Bruce, how heavy is your workload these days? Would you mind if I ask you to collect the list comments, have me wait for a few days until the discussions and updates settle down and give me "Ok, all ready to be pulled" after that?

#4 lore raw

Re: [PATCH] user-manual: fix branch names in examples

Quoted 3 lines · Junio C Hamano

Thanks everybody for participating in these fixups.

Bruce, how heavy is your workload these days?

Probably lighter than yours.

Quoted 3 lines

Would you mind if I ask you to collect the list comments, have me wait for a few days until the discussions and updates settle down and give me "Ok, all ready to be pulled" after that?

Yep, that should be no problem.

--b.