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

Re: [PATCH 1/5] Add test case for basic commit functionality.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2007, 04:18 UTC
Message-ID
<7vodhtgq99.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<11858309261111-git-send-email-krh@redhat.com>
Kristian Høgsberg <krh@redhat.com> writes:
> +# Pick a date so we get consistent commits. 7/7/07 means good luck!
> +export GIT_AUTHOR_DATE="July 7, 2007"
> +export GIT_COMMITTER_DATE="July 7, 2007"

Other scripts use test_tick for consistent commits; just to let you know, the above is as good if you intend to use only one timestamp.

Show 5 quoted lines
> +echo "bongo bongo" >file
> +test_expect_success \
> +	"initial status" \
> +	"git-add file && \
> +	 git-status | grep 'Initial commit'"

We tend to prefer to have the "create testfile" part also in the test.

> +test_expect_failure \
> +	"fail initial amend" \
> +	"git-commit -m initial --amend"

Does it fail because it is initial, or because these two options, "-m <msg>" and "--amend", are incompatible?

> +echo "bongo bongo bongo" >file
Ditto.
Show 6 quoted lines
> +cat >msg <<EOF
> +		
> +
> +  
> +Signed-off-by: hula
> +EOF

... except <<here text are left outside of test_expect_success because there were reports that some shells cannot grok here text in eval correctly.

Previous: Junio C HamanoNext: Kristian Høgsberg
Message 17 of 19 in “Add test case for basic commit functionality.”
  1. 1/5 Add test case for basic commit functionality.Kristian Høgsberg, Jul 30, 2007
  2. 2/5 Enable wt-status output to a given FILE pointer.Kristian Høgsberg, Jul 30, 2007
  3. 3/5 Add strbuf_printf() to do formatted printing to a strbuf.Kristian Høgsberg, Jul 30, 2007
  4. 4/5 Make builtin-commit-tree use a strbuf instead of hand-rolled realloc buffer.Kristian Høgsberg, Jul 30, 2007
  5. 5/5 Split out the actual commit creation from the option parsing etc.Kristian Høgsberg, Jul 30, 2007
  6. Junio C HamanoJul 31, 2007
  7. Kristian HøgsbergJul 31, 2007
  8. Junio C HamanoJul 31, 2007
  9. Junio C HamanoJul 31, 2007
  10. Kristian HøgsbergJul 31, 2007
  11. Johannes SchindelinJul 31, 2007
  12. Kristian HøgsbergJul 31, 2007
  13. Johannes SchindelinJul 31, 2007
  14. Kristian HøgsbergJul 31, 2007
  15. Add strbuf_printf() to do formatted printing to a strbuf.Kristian Høgsberg, Jul 31, 2007
  16. Junio C HamanoJul 31, 2007
  17. Junio C HamanoJul 31, 2007
  18. Kristian HøgsbergJul 31, 2007
  19. Add test case for basic commit functionality.Kristian Høgsberg, Jul 31, 2007

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.