git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Emily Shaffer <emilyshaffer@google.com>
To: git@vger.kernel.org
Cc: Emily Shaffer <emilyshaffer@google.com>,
	Christian Couder <christian.couder@gmail.com>
Subject: [PATCH] doc: add some nit fixes to MyFirstContribution
Date: Wed, 29 May 2019 13:18:09 -0700	[thread overview]
Message-ID: <20190529201809.169065-1-emilyshaffer@google.com> (raw)
In-Reply-To: <20190517190359.21676-1-emilyshaffer@google.com>

A trial run-through of the tutorial revealed a few typos and missing
commands in the tutorial itself. This commit fixes typos, clarifies
which lines to keep or modify in some places, and adds a section on
putting the git-psuh binary into the gitignore.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
---
This patch is based on next, as the doc hasn't made it to master yet.

- Missing `cd git` after cloning the repo
- Documented how to add git-psuh to the gitignore
- Documented the need to leave prior printfs in place during the
  tutorial
- Typos: missing ;, stray newline
- Missing `git add builtin/psuh.c` in a couple of places; this could
  also have been done by adding the filename to the end of the commit
  call, but I don't think that's a good habit (as opposed to staging all
  changes, inspecting the wt state, and then committing). Open for
  debate.

Big thanks to Christian for the trial run and review.

 - Emily

 Documentation/MyFirstContribution.txt | 31 +++++++++++++++++++++++----
 1 file changed, 27 insertions(+), 4 deletions(-)

diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index 274df8575b..895b7cfd4f 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -35,6 +35,7 @@ the mirror on GitHub.
 
 ----
 $ git clone https://github.com/git/git git
+$ cd git
 ----
 
 [[identify-problem]]
@@ -164,8 +165,28 @@ $ ./bin-wrappers/git psuh
 
 Check it out! You've got a command! Nice work! Let's commit this.
 
+`git status` reveals modified `Makefile`, `builtin.h`, and `git.c` as well as
+untracked `builtin/psuh.c` and `git-psuh`. First, let's take care of the binary,
+which should be ignored. Open `.gitignore` in your editor, find `/git-push`, and
+add an entry for your new command in alphabetical order:
+
+----
+...
+/git-prune-packed
+/git-psuh
+/git-pull
+/git-push
+/git-quiltimport
+/git-range-diff
+...
+----
+
+Checking `git status` again should show that `git-psuh` has been removed from
+the untracked list and `.gitignore` has been added to the modified list. Now we
+can stage and commit:
+
 ----
-$ git add Makefile builtin.h builtin/psuh.c git.c
+$ git add Makefile builtin.h builtin/psuh.c git.c .gitignore
 $ git commit -s
 ----
 
@@ -211,7 +232,8 @@ on the reference implementation linked at the top of this document.
 It's probably useful to do at least something besides printing out a string.
 Let's start by having a look at everything we get.
 
-Modify your `cmd_psuh` implementation to dump the args you're passed:
+Modify your `cmd_psuh` implementation to dump the args you're passed, keeping
+existing `printf()` calls in place:
 
 ----
 	int i;
@@ -243,7 +265,7 @@ function body:
 
 ...
 
-	git_config(git_default_config, NULL)
+	git_config(git_default_config, NULL);
 	if (git_config_get_string_const("user.name", &cfg_name) > 0)
 		printf(_("No name is found in config\n"));
 	else
@@ -315,6 +337,7 @@ Run it again. Check it out - here's the (verbose) name of your current branch!
 Let's commit this as well.
 
 ----
+$ git add builtin/psuh.c
 $ git commit -sm "psuh: print the current branch"
 ----
 
@@ -366,6 +389,7 @@ see the subject line of the most recent commit in `origin/master` that you know
 about. Neat! Let's commit that as well.
 
 ----
+$ git add builtin/psuh.c
 $ git commit -sm "psuh: display the top of origin/master"
 ----
 
@@ -418,7 +442,6 @@ OUTPUT
 ------
 ...
 
-
 GIT
 ---
 Part of the linkgit:git[1] suite
-- 
2.22.0.rc1.257.g3120a18244-goog


      parent reply	other threads:[~2019-05-29 20:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 18:32 [PATCH 0/1] documentation: add lab for first contribution Emily Shaffer via GitGitGadget
2019-04-11 18:32 ` [PATCH 1/1] " Emily Shaffer via GitGitGadget
2019-04-12  3:20   ` Junio C Hamano
2019-04-12 22:03     ` Emily Shaffer
2019-04-13  5:39       ` Junio C Hamano
2019-04-15 17:26         ` Emily Shaffer
2019-04-11 21:03 ` [PATCH 0/1] " Josh Steadmon
2019-04-12  2:35 ` Junio C Hamano
2019-04-12 22:58   ` Emily Shaffer
2019-04-16 20:26 ` [PATCH v2 " Emily Shaffer via GitGitGadget
2019-04-16 20:26   ` [PATCH v2 1/1] " Emily Shaffer via GitGitGadget
2019-04-17  5:32     ` Junio C Hamano
2019-04-17  8:07       ` Eric Sunshine
2019-04-18  0:05         ` Junio C Hamano
2019-04-17 23:16       ` Emily Shaffer
2019-04-16 21:13   ` [PATCH v2 0/1] " Emily Shaffer
2019-04-19 16:57   ` [PATCH v3] " Emily Shaffer
2019-04-21 10:52     ` Junio C Hamano
2019-04-22 22:27       ` Emily Shaffer
2019-04-23 19:34     ` [PATCH v4] documentation: add tutorial " Emily Shaffer
2019-04-30 18:59       ` Josh Steadmon
2019-05-02  0:57         ` Emily Shaffer
2019-05-03  2:11       ` Phil Hord
2019-05-07 19:05         ` Emily Shaffer
2019-05-06 22:28       ` Jonathan Tan
2019-05-07 19:59         ` Emily Shaffer
2019-05-07 20:32           ` Jonathan Tan
2019-05-08  2:45         ` Junio C Hamano
2019-05-07 21:30       ` [PATCH v5 0/2] documentation: add lab " Emily Shaffer
2019-05-07 21:30         ` [PATCH v5 1/2] documentation: add tutorial " Emily Shaffer
2019-05-07 23:25           ` Emily Shaffer
2019-05-08  3:46           ` Junio C Hamano
2019-05-08 18:58             ` Emily Shaffer
2019-05-08 19:53               ` Jonathan Tan
2019-05-07 21:30         ` [PATCH v5 2/2] documentation: add anchors to MyFirstContribution Emily Shaffer
2019-05-08  3:30         ` [PATCH v5 0/2] documentation: add lab for first contribution Junio C Hamano
2019-05-17 19:03         ` [PATCH v6 0/2] documentation: add tutorial " Emily Shaffer
2019-05-17 19:07           ` [PATCH v6 1/2] " Emily Shaffer
2019-05-26  7:48             ` Christian Couder
2019-05-29 20:09               ` Emily Shaffer
2019-10-18 16:40             ` SZEDER Gábor
2019-10-18 22:54               ` Emily Shaffer
2019-05-17 19:07           ` [PATCH v6 2/2] documentation: add anchors to MyFirstContribution Emily Shaffer
2019-05-29 20:18           ` Emily Shaffer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190529201809.169065-1-emilyshaffer@google.com \
    --to=emilyshaffer@google.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).