git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff Hostetler <git@jeffhostetler.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v6 9/9] status: unit tests for --porcelain=v2
Date: Thu, 11 Aug 2016 16:51:28 -0400	[thread overview]
Message-ID: <57ACE550.9040501@jeffhostetler.com> (raw)
In-Reply-To: <xmqqtwer17b6.fsf@gitster.mtv.corp.google.com>



On 08/11/2016 02:36 PM, Junio C Hamano wrote:
> Jeff Hostetler <git@jeffhostetler.com> writes:
>
>> From: Jeff Hostetler <jeffhost@microsoft.com>
>> +. ./test-lib.sh
>> +
>> +OID_EMPTY=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>
> It seems that test-lib.sh these days has EMPTY_BLOB defined for your
> use.  You can remove this and replace its use (just two lines) with
> $EMPTY_BLOB down in the "add -N" test.

That's a recent addition to test-lib.sh. I'll rebase my series
onto a more recent master to get that.


>> +test_expect_success setup '
>> +	test_tick &&
>> +	git config --local core.autocrlf false &&
>
> I'd suggest removing "--local".
>
> Existing use of "git config" in the test suite, unless their use is
> about testing "git config" itself to validate the operation of the
> --local/--global/--system options, do not seem to explicitly say
> "--local", which is the default anyway.

ok. just being cautious, but if that's the convention, that's fine.


>> +test_expect_success 'after first commit, make dirt, confirm unstaged changes' '
>
> Did you mean s/dirt/dirty/?  "make and confirm unstaged changes"
> would be sufficient.  Because "confirming" is implicit (as these
> are all tests), "after the first commit, modify working tree files"
> might even be better, perhaps?
>
>> +	echo x >>file_x &&
>> +	OID_X1=$(git hash-object -t blob -- file_x) &&
>> +	rm file_z &&
>> +	H0=$(git rev-parse HEAD) &&
>> + ...

got it.


>> +test_expect_success 'after first commit, stage dirt, confirm staged changes' '
>
> What you "git add" is meant to be good changes, so they are no
> longer dirt ;-)  More importantly, because I never heard of "dirt"
> used in Git context, it is unclear if it is an untracked file, a
> modification that is not meant to be committed immediately, or what.
>
> "after the first commit, fully add changes to the index"?

reworded and simplified.


>> +	git add file_x &&
>> +	git rm file_z &&
>> +	H0=$(git rev-parse HEAD) &&
>> +
>> +	cat >expect <<-EOF &&
>> +	# branch.oid $H0
>> +	# branch.head master
>> +	1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
>> +	1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z
>> +	? actual
>> +	? expect
>> +	EOF
>
>> +test_expect_success 'after first commit, also stage rename, confirm 2 path line format' '
>> +	git mv file_y renamed_y &&
>> +	H0=$(git rev-parse HEAD) &&
>> +
>> +	q_to_tab >expect <<-EOF &&
>> +	# branch.oid $H0
>> +	# branch.head master
>> +	1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
>> +	1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z
>> +	2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
>> +	? actual
>> +	? expect
>> +	EOF
>> +
>> +	git status --porcelain=v2 --branch --untracked-files=all >actual &&
>> +	test_cmp expect actual
>> +'
>
> Do we want to test -z format on this, too?

Sure.


I'll send these up in a v7 series in a few minutes.

Thanks
Jeff


  reply	other threads:[~2016-08-11 20:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11 14:45 [PATCH v6 0/9] status: V2 porcelain status Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 1/9] status: rename long-format print routines Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 2/9] status: cleanup API to wt_status_print Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 3/9] status: support --porcelain[=<version>] Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 4/9] status: collect per-file data for --porcelain=v2 Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 5/9] status: print per-file porcelain v2 status data Jeff Hostetler
2016-08-11 14:45 ` [PATCH v6 6/9] status: print branch info with --porcelain=v2 --branch Jeff Hostetler
2016-08-11 14:46 ` [PATCH v6 7/9] git-status.txt: describe --porcelain=v2 format Jeff Hostetler
2016-08-11 14:46 ` [PATCH v6 8/9] test-lib-functions.sh: Add lf_to_nul Jeff Hostetler
2016-08-11 14:46 ` [PATCH v6 9/9] status: unit tests for --porcelain=v2 Jeff Hostetler
2016-08-11 18:36   ` Junio C Hamano
2016-08-11 20:51     ` Jeff Hostetler [this message]
2016-08-11 18:59 ` [PATCH v6 0/9] status: V2 porcelain status Junio C Hamano

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=57ACE550.9040501@jeffhostetler.com \
    --to=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    /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).