Skip to content

Commit d868448

Browse files
committed
Update recording-changes for libgit2
libgit2 has replaced Grit as the sample project for explaining how to commit. Update the examples accordingly.
1 parent c9bac1d commit d868448

File tree

1 file changed

+36
-40
lines changed

1 file changed

+36
-40
lines changed

book/02-git-basics/sections/recording-changes.asc

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ doc/**/*.txt
237237

238238
[TIP]
239239
====
240-
GitHub maintains a fairly comprehensive list of good `.gitignore` file examples for dozens or projects and languages at https://github.com/github/gitignore[] if you want a starting point for your project.
240+
GitHub maintains a fairly comprehensive list of good `.gitignore` file examples for dozens of projects and languages at https://github.com/github/gitignore[] if you want a starting point for your project.
241241
====
242242

243243
[[_git_diff_staged]]
@@ -273,20 +273,19 @@ To see what you've changed but not yet staged, type `git diff` with no other arg
273273
----
274274
$ git diff
275275
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
276-
index 3cb747f..e445e28 100644
276+
index 8ebb991..643e24f 100644
277277
--- a/CONTRIBUTING.md
278278
+++ b/CONTRIBUTING.md
279-
@@ -36,6 +36,10 @@ def main
280-
@commit.parents[0].parents[0].parents[0]
281-
end
282-
283-
+ run_code(x, 'commits 1') do
284-
+ git.commits.size
285-
+ end
286-
+
287-
run_code(x, 'commits 2') do
288-
log = git.commits('master', 15)
289-
log.size
279+
@@ -65,7 +65,8 @@ branch directly, things can get messy.
280+
Please include a nice description of your changes when you submit your PR;
281+
if we have to read the whole diff to figure out why you're contributing
282+
in the first place, you're less likely to get feedback and have your change
283+
-merged in.
284+
+merged in. Also, split your changes into comprehensive chunks if you patch is
285+
+longer than a dozen lines.
286+
287+
If you are starting to work on a particular area, feel free to submit a PR
288+
that highlights your work in progress (and note in the PR title that it's
290289
----
291290

292291
That command compares what is in your working directory with what is in your staging area.
@@ -303,11 +302,8 @@ new file mode 100644
303302
index 0000000..03902a1
304303
--- /dev/null
305304
+++ b/README
306-
@@ -0,0 +1,4 @@
305+
@@ -0,0 +1 @@
307306
+My Project
308-
+
309-
+ This is my project and it is amazing.
310-
+
311307
----
312308

313309
It's important to note that `git diff` by itself doesn't show all changes made since your last commit – only changes that are still unstaged.
@@ -318,7 +314,7 @@ For another example, if you stage the `CONTRIBUTING.md` file and then edit it, y
318314
[source,console]
319315
----
320316
$ git add CONTRIBUTING.md
321-
$ echo '# test line' >> CONTRIBUTING.md
317+
$ echo 'test line' >> CONTRIBUTING.md
322318
$ git status
323319
On branch master
324320
Changes to be committed:
@@ -339,13 +335,13 @@ Now you can use `git diff` to see what is still unstaged
339335
----
340336
$ git diff
341337
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
342-
index e445e28..86b2f7c 100644
338+
index 643e24f..87f08c8 100644
343339
--- a/CONTRIBUTING.md
344340
+++ b/CONTRIBUTING.md
345-
@@ -127,3 +127,4 @@ end
346-
main()
347-
348-
##pp Grit::GitRuby.cache_client.stats
341+
@@ -119,3 +119,4 @@ at the
342+
## Starter Projects
343+
344+
See our [projects list](https://github.com/libgit2/libgit2/blob/development/PROJECTS.md).
349345
+# test line
350346
----
351347

@@ -355,20 +351,19 @@ and `git diff --cached` to see what you've staged so far:
355351
----
356352
$ git diff --cached
357353
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
358-
index 3cb747f..e445e28 100644
354+
index 8ebb991..643e24f 100644
359355
--- a/CONTRIBUTING.md
360356
+++ b/CONTRIBUTING.md
361-
@@ -36,6 +36,10 @@ def main
362-
@commit.parents[0].parents[0].parents[0]
363-
end
364-
365-
+ run_code(x, 'commits 1') do
366-
+ git.commits.size
367-
+ end
368-
+
369-
run_code(x, 'commits 2') do
370-
log = git.commits('master', 15)
371-
log.size
357+
@@ -65,7 +65,8 @@ branch directly, things can get messy.
358+
Please include a nice description of your changes when you submit your PR;
359+
if we have to read the whole diff to figure out why you're contributing
360+
in the first place, you're less likely to get feedback and have your change
361+
-merged in.
362+
+merged in. Also, split your changes into comprehensive chunks if you patch is
363+
+longer than a dozen lines.
364+
365+
If you are starting to work on a particular area, feel free to submit a PR
366+
that highlights your work in progress (and note in the PR title that it's
372367
----
373368

374369
[[_git_difftool]]
@@ -472,14 +467,15 @@ If you simply remove the file from your working directory, it shows up under the
472467

473468
[source,console]
474469
----
475-
$ rm grit.gemspec
470+
$ rm PROJECTS.md
476471
$ git status
477472
On branch master
473+
Your branch is up-to-date with 'origin/master'.
478474
Changes not staged for commit:
479475
(use "git add/rm <file>..." to update what will be committed)
480476
(use "git checkout -- <file>..." to discard changes in working directory)
481477
482-
deleted: grit.gemspec
478+
deleted: PROJECTS.md
483479
484480
no changes added to commit (use "git add" and/or "git commit -a")
485481
----
@@ -488,14 +484,14 @@ Then, if you run `git rm`, it stages the file's removal:
488484

489485
[source,console]
490486
----
491-
$ git rm grit.gemspec
492-
rm 'grit.gemspec'
487+
$ git rm PROJECTS.md
488+
rm 'PROJECTS.md'
493489
$ git status
494490
On branch master
495491
Changes to be committed:
496492
(use "git reset HEAD <file>..." to unstage)
497493
498-
deleted: grit.gemspec
494+
deleted: PROJECTS.md
499495
----
500496

501497
The next time you commit, the file will be gone and no longer tracked.

0 commit comments

Comments
 (0)