git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v4] documentation: add tutorial for first contribution

From
Josh Steadmon <steadmon@google.com>
Date
Apr 30, 2019, 18:59 UTC
Message-ID
<20190430185923.GA26779@google.com>
In-Reply-To
<20190423193410.101803-1-emilyshaffer@google.com>
Just a couple typo fixes listed below:

On 2019.04.23 12:34, Emily Shaffer wrote: [snip]

Show 27 quoted lines
> +=== Implementation
> +
> +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:
> +
> +----
> +	int i;
> +
> +	...
> +
> +	printf(Q_("Your args (there is %d):\n",
> +		  "Your args (there are %d):\n",
> +		  argc),
> +	       argc);
> +	for (i = 0; i < argc; i++) {
> +		printf("%d: %s\n", i, argv[i]);
> +	}
> +	printf(_("Your current working directory:\n<top-level>%s%s\n"),
> +	       prefix ? "/" : "", prefix ? prefix : "");
> +
> +----
> +
> +Build and try it. As you may expect, there's pretty much just whatever we give
> +on the command line, including the name of our command. (If `prefix` is empty
> +for you, try `cd Documentation/ && ../bin-wrappers/git/ psuh`). That's not so
Looks like you have an errant "/" after "git".
[snip]
Show 73 quoted lines
> +=== Adding documentation
> +
> +Awesome! You've got a fantastic new command that you're ready to share with the
> +community. But hang on just a minute - this isn't very user-friendly. Run the
> +following:
> +
> +----
> +$ ./bin-wrappers/git help psuh
> +----
> +
> +Your new command is undocumented! Let's fix that.
> +
> +Take a look at `Documentation/git-*.txt`. These are the manpages for the
> +subcommands that Git knows about. You can open these up and take a look to get
> +acquainted with the format, but then go ahead and make a new file
> +`Documentation/git-psuh.txt`. Like with most of the documentation in the Git
> +project, help pages are written with AsciiDoc (see CodingGuidelines, "Writing
> +Documentation" section). Use the following template to fill out your own
> +manpage:
> +
> +// Surprisingly difficult to embed AsciiDoc source within AsciiDoc.
> +[listing]
> +....
> +git-psuh(1)
> +===========
> +
> +NAME
> +----
> +git-psuh - Delight users' typo with a shy horse
> +
> +
> +SYNOPSIS
> +--------
> +[verse]
> +'git-psuh'
> +
> +DESCRIPTION
> +-----------
> +...
> +
> +OPTIONS[[OPTIONS]]
> +------------------
> +...
> +
> +OUTPUT
> +------
> +...
> +
> +
> +GIT
> +---
> +Part of the linkgit:git[1] suite
> +....
> +
> +The most important pieces of this to note are the file header, underlined by =,
> +the NAME section, and the SYNOPSIS, which would normally contain the grammar if
> +your command took arguments. Try to use well-established manpage headers so your
> +documentation is consistent with other Git and UNIX manpages; this makes life
> +easier for your user, who can skip to the section they know contains the
> +information they need.
> +
> +Now that you've written your manpage, you'll need to build it explicitly. We
> +convert your AsciiDoc to troff which is man-readable like so:
> +
> +----
> +$ make all doc
> +$ man Documentation/git-psuh.1
> +----
> +
> +or
> +
> +----
> +$ make -C Documentation/git-psuh.1
Needs a space after "Documentation/".
Previous: Emily ShafferNext: Emily Shaffer
Message 21 of 44 in “documentation: add lab for first contribution”
  1. 0/1 documentation: add lab for first contributionEmily Shaffer via GitGitGadget, Apr 11, 2019
  2. 1/1 documentation: add lab for first contributionEmily Shaffer via GitGitGadget, Apr 11, 2019
  3. Junio C HamanoApr 12, 2019
  4. Emily ShafferApr 12, 2019
  5. Junio C HamanoApr 13, 2019
  6. Emily ShafferApr 15, 2019
  7. Josh SteadmonApr 11, 2019
  8. Junio C HamanoApr 12, 2019
  9. Emily ShafferApr 12, 2019
  10. 0/1 documentation: add lab for first contributionEmily Shaffer via GitGitGadget, Apr 16, 2019
  11. 1/1 documentation: add lab for first contributionEmily Shaffer via GitGitGadget, Apr 16, 2019
  12. Junio C HamanoApr 17, 2019
  13. Eric SunshineApr 17, 2019
  14. Junio C HamanoApr 18, 2019
  15. Emily ShafferApr 17, 2019
  16. Emily ShafferApr 16, 2019
  17. documentation: add lab for first contributionEmily Shaffer, Apr 19, 2019
  18. Junio C HamanoApr 21, 2019
  19. Emily ShafferApr 22, 2019
  20. documentation: add tutorial for first contributionEmily Shaffer, Apr 23, 2019
  21. Josh SteadmonApr 30, 2019
  22. Emily ShafferMay 2, 2019
  23. Phil HordMay 3, 2019
  24. Emily ShafferMay 7, 2019
  25. Jonathan TanMay 6, 2019
  26. Emily ShafferMay 7, 2019
  27. Jonathan TanMay 7, 2019
  28. Junio C HamanoMay 8, 2019
  29. 0/2 documentation: add lab for first contributionEmily Shaffer, May 7, 2019
  30. 1/2 documentation: add tutorial for first contributionEmily Shaffer, May 7, 2019
  31. Emily ShafferMay 7, 2019
  32. Junio C HamanoMay 8, 2019
  33. Emily ShafferMay 8, 2019
  34. Jonathan TanMay 8, 2019
  35. 2/2 documentation: add anchors to MyFirstContributionEmily Shaffer, May 7, 2019
  36. Junio C HamanoMay 8, 2019
  37. 0/2 documentation: add tutorial for first contributionEmily Shaffer, May 17, 2019
  38. 1/2 documentation: add tutorial for first contributionEmily Shaffer, May 17, 2019
  39. Christian CouderMay 26, 2019
  40. Emily ShafferMay 29, 2019
  41. SZEDER GáborOct 18, 2019
  42. Emily ShafferOct 18, 2019
  43. 2/2 documentation: add anchors to MyFirstContributionEmily Shaffer, May 17, 2019
  44. doc: add some nit fixes to MyFirstContributionEmily Shaffer, May 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.