git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's cooking in git.git (Jun 2010, #05; Sun, 27)
@ 2010-06-27 20:11 Junio C Hamano
  2010-06-28  7:30 ` [PATCH] Add test for correct coloring of git log --decoration Nazri Ramliy
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2010-06-27 20:11 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'.  The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.

I'd like to have most of the topics still cooking in 'next' in upcoming 1.7.2
while I don't think any of the ones out of 'next' is ready; that makes
today the perfect time to tag 1.7.2-rc0 ;-)

--------------------------------------------------
[Graduated to "master"]

* ab/blame-textconv (2010-06-07) 3 commits
  (merged to 'next' on 2010-06-23 at a7da5af)
 + t/t8006: test textconv support for blame
 + textconv: support for blame
 + textconv: make the API public
 (this branch is used by cp/textconv-cat-file.)

* cp/textconv-cat-file (2010-06-09) 5 commits
 + git-cat-file.txt: Document --textconv
  (merged to 'next' on 2010-06-23 at eb6f216)
 + t/t8007: test textconv support for cat-file
 + textconv: support for cat_file
 + sha1_name: add get_sha1_with_context()

* jn/show-num-walks (2010-06-01) 1 commit
  (merged to 'next' on 2010-06-23 at e61649c)
 + DWIM 'git show -5' to 'git show --do-walk -5'

* js/maint-am-rebase-invalid-author (2010-06-16) 1 commit
  (merged to 'next' on 2010-06-23 at b345ad5)
 + am: use get_author_ident_from_commit instead of mailinfo when rebasing

* pb/maint-perl-errmsg-no-dir (2010-06-18) 1 commit
  (merged to 'next' on 2010-06-23 at 990ea67)
 + Git.pm: better error message

* tr/send-email-8bit (2010-06-17) 1 commit
  (merged to 'next' on 2010-06-23 at be75199)
 + send-email: ask about and declare 8bit mails

--------------------------------------------------
[New Topics]

* jk/url-decode (2010-06-24) 1 commit
 - url_decode: URL scheme ends with a colon and does not require a slash

* jl/maint-submodule-ignore-dirty-submodules (2010-06-25) 1 commit
 - git submodule: ignore dirty submodules for summary and status
 (this branch is used by jl/status-ignore-submodules and jl/status-ignore-submodules; uses jl/maint-diff-ignore-submodules.)

* jl/status-ignore-submodules (2010-06-25) 1 commit
 - Add the option "--ignore-submodules" to "git status"
 (this branch uses jl/maint-diff-ignore-submodules, jl/maint-submodule-ignore-dirty-submodules and jl/maint-submodule-ignore-dirty-submodules.)

These two looked sane; will merge to 'next' shortly.

* mg/doc-rev-parse-treepath-syntax (2010-06-27) 1 commit
 - git-rev-parse.txt: Document ":path" specifier

Swapping the two bullets in the existing documentation without anything
else may be a simpler and easier-to-read alternative.

* jp/string-list-api-cleanup (2010-06-26) 6 commits
  (merged to 'next' on 2010-06-27 at b1e8b97)
 + string_list: Fix argument order for string_list_append
 + string_list: Fix argument order for string_list_lookup
 + string_list: Fix argument order for string_list_insert_at_index
 + string_list: Fix argument order for string_list_insert
 + string_list: Fix argument order for for_each_string_list
 + string_list: Fix argument order for print_string_list
 (this branch is used by jn/grep-open.)

* mg/rev-parse-tests (2010-05-14) 2 commits
  (merged to 'next' on 2010-06-27 at 3336145)
 + t6018: make sure all tested symbolic names are different revs
 + t6018: add tests for rev-list's --branches and --tags

Resurrects the tests from discarded mg/rev-parse-option-sifter-deprecation.

--------------------------------------------------
[Stalled -- would discard unless there are some movements soon]

* js/rebase-origin-x (2010-02-05) 1 commit
 - [RFC w/o test and incomplete] rebase: add -x option to record original commit name

I retract my objection against the idea of -x; needs polishing before
moving forward.

* zl/mailinfo-recode-patch (2010-06-14) 2 commits
 - add --recode-patch option to git-am
 - add --recode-patch option to git-mailinfo

Perhaps another round is coming?

* rr/svn-export (2010-06-10) 7 commits
 - Add LICENSE
 - Add SVN dump parser
 - Add infrastructure to write revisions in fast-export format
 - Add stream helper library
 - Add library for string-specific memory pool
 - Add cpp macro implementation of treaps
 - Add memory pool library

I recall there was another round of re-roll planned for this one.

* ab/i18n (2010-06-15) 3 commits
 . Add initial C, Shell and Perl gettext translations
 . fixup! Add infrastructure
 . Add infrastructure for translating Git with gettext

I saw a new round on the list, but I haven't got around picking it up yet.

--------------------------------------------------
[Cooking]

* ps/gitweb-soc (2010-06-02) 2 commits
  (merged to 'next' on 2010-06-13 at 92245ae)
 + git-instaweb: Add option to reuse previous config file
 + Makefile: Use $(sharedir)/gitweb for target 'install-gitweb'

If we are going to have a configuration variable to control this, I
strongly suspect that --reuse-config should be renamed so that the
variable can be named more sanely and in line with whatever option
that replaces it.

* ab/tap (2010-06-26) 6 commits
  (merged to 'next' on 2010-06-27 at a761d14)
 + t9700: Use Test::More->builder, not $Test::Builder::Test
 + tests: Say "pass" rather than "ok" on empty lines for TAP
 + tests: Skip tests in a way that makes sense under TAP
 + test-lib: output a newline before "ok" under a TAP harness
 + test-lib: Make the test_external_* functions TAP-aware
 + test-lib: Adjust output to be valid TAP format

Updated with a newer round with support for older Test::More before 0.94
version.

* ar/decorate-color (2010-06-24) 4 commits
 - Allow customizable commit decorations colors
 - log --decorate: Colorize commit decorations
 - log-tree.c: Use struct name_decoration's type for classifying decoration
 - commit.h: add 'type' to struct name_decoration

Tests, perhaps?  Otherwise looked sane.

* tc/checkout-B (2010-06-24) 3 commits
 - builtin/checkout: learn -B
 - builtin/checkout: reword hint for -b
 - add tests for checkout -b

* as/maint-completion-set-u-fix (2010-06-17) 1 commit
  (merged to 'next' on 2010-06-27 at 24ce8c2)
 + bash-completion: Fix __git_ps1 to work with "set -u"

* tr/rev-list-count (2010-06-17) 2 commits
  (merged to 'next' on 2010-06-27 at 0525b63)
 + bash completion: Support "divergence from upstream" messages in __git_ps1
 + rev-list: introduce --count option

* jl/maint-diff-ignore-submodules (2010-06-25) 3 commits
  (merged to 'next' on 2010-06-25 at d75dbf1)
 + t4027,4041: Use test -s to test for an empty file
  (merged to 'next' on 2010-06-23 at 057acb7)
 + Add optional parameters to the diff option "--ignore-submodules"
 + git diff: rename test that had a conflicting name
 (this branch is used by jl/maint-submodule-ignore-dirty-submodules and jl/status-ignore-submodules.)

* jn/grep-open (2010-06-26) 8 commits
  (merged to 'next' on 2010-06-27 at 84c0976)
 + Merge branch 'jp/string-list-api-cleanup' into jn/grep-open
  (merged to 'next' on 2010-06-22 at 8edca58)
 + t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script
 + t/t7811-grep-open.sh: ensure fake "less" is made executable
 + t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
  (merged to 'next' on 2010-06-18 at cf96ea8)
 + grep -O: allow optional argument specifying the pager (or editor)
 + grep: Add the option '--open-files-in-pager'
 + Unify code paths of threaded greps
 + grep: refactor grep_objects loop into its own function
 (this branch uses jp/string-list-api-cleanup.)

* eb/double-convert-before-merge (2010-06-16) 1 commit
 - ll-merge: Normalize files before merging

I saw a new round on the list, but I haven't got around picking it up yet.

* cc/cherry-pick-stdin (2010-06-14) 2 commits
  (merged to 'next' on 2010-06-27 at 3af0bba)
 + revert: accept arbitrary rev-list options
 + t3508 (cherry-pick): futureproof against unmerged files

--------------------------------------------------
[Discarded]

* mg/rev-parse-lrbranches-locals (2010-05-14) 1 commit
 . revlist: Introduce --lrbranches and --locals revision specifiers
 (this branch uses mg/rev-parse-option-sifter-deprecation.)

* mg/rev-parse-option-sifter-deprecation (2010-05-14) 3 commits
 . t6018: make sure all tested symbolic names are different revs
 . t6018: add tests for rev-list's --branches and --tags
 . rev-parse: deprecate use as an option sifter

The tests are resurrected in a separate branch, though.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Add test for correct coloring of git log --decoration
  2010-06-27 20:11 What's cooking in git.git (Jun 2010, #05; Sun, 27) Junio C Hamano
@ 2010-06-28  7:30 ` Nazri Ramliy
  2010-06-29  5:43   ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Nazri Ramliy @ 2010-06-28  7:30 UTC (permalink / raw)
  To: gitster, git; +Cc: Nazri Ramliy

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
---
On Mon, Jun 28, 2010 at 4:11 AM, Junio C Hamano <gitster@pobox.com> wrote:
> * ar/decorate-color (2010-06-24) 4 commits
>  - Allow customizable commit decorations colors
>  - log --decorate: Colorize commit decorations
>  - log-tree.c: Use struct name_decoration's type for classifying decoration
>  - commit.h: add 'type' to struct name_decoration
> 
> Tests, perhaps?  Otherwise looked sane.

Here is a proposed test for checking if the decorations are colored correctly.
It should be applied on top of 5e11bee65f601ba97dc4c61c75fcb2f448fdcb1c in pu.

I've tried adding 

	log --decorate --all --oneline --color=always

to t4013-diff-various.sh but it seems a bit out of place because my test only
test for colors, while no other test in that file test for colors, hence the
new test file (t4207-log-decoration-colors.sh).

nazri

 t/t4207-log-decoration-colors.sh |   70 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)
 create mode 100755 t/t4207-log-decoration-colors.sh

diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
new file mode 100755
index 0000000..260e71f
--- /dev/null
+++ b/t/t4207-log-decoration-colors.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Nazri Ramliy
+#
+
+test_description='Test for "git log --decorate" colors
+'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+  echo foo > foo.txt &&
+  git add foo.txt &&
+  test_tick &&
+  git commit -m first &&
+
+  echo bar > bar.txt &&
+  git add bar.txt &&
+  test_tick &&
+  git commit -m second &&
+
+  test_tick &&
+  EDITOR=cat git tag v1.0 &&
+
+  git clone . local_clone &&
+
+  cd local_clone &&
+  git config diff.color.commit yellow &&
+  git config color.decorate.branch green &&
+  git config color.decorate.remoteBranch red &&
+  git config color.decorate.tag yellow &&
+  git config color.decorate.stash magenta &&
+  git config color.decorate.HEAD cyan &&
+
+  echo baz >> foo.txt &&
+  git stash save baz
+'
+
+get_color()
+{
+  git config --get-color no.such.slot "$1"
+}
+
+# Colors
+c_reset=$(get_color reset)
+c_commit=$(get_color yellow)
+c_branch=$(get_color green)
+c_remoteBranch=$(get_color red)
+c_tag=$(get_color yellow)
+c_stash=$(get_color magenta)
+c_HEAD=$(get_color cyan)
+
+cat > expected << EOF
+${c_commit}COMMIT_ID (${c_stash}refs/stash${c_reset}${c_commit})${c_reset} On master: baz
+${c_commit}COMMIT_ID (${c_HEAD}HEAD${c_reset}${c_commit},\
+ ${c_tag}tag: v1.0${c_reset}${c_commit},\
+ ${c_remoteBranch}origin/master${c_reset}${c_commit},\
+ ${c_remoteBranch}origin/HEAD${c_reset}${c_commit},\
+ ${c_branch}master${c_reset}${c_commit})${c_reset} second
+${c_commit}COMMIT_ID${c_reset} first
+EOF
+
+# We want log to show all, but the second parent to refs/stash is irrelevant
+# to this test since it does not contain any decoration, hence --first-parent
+test_expect_success 'Commit Decorations Colored Correctly' '
+  git log --first-parent --abbrev=10 --all --decorate --oneline --color=always |sed "s/[0-9a-f]\{10,10\}/COMMIT_ID/" > out &&
+  test_cmp expected out
+'
+
+test_done
-- 
1.7.1.245.g7c42e.dirty

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add test for correct coloring of git log --decoration
  2010-06-28  7:30 ` [PATCH] Add test for correct coloring of git log --decoration Nazri Ramliy
@ 2010-06-29  5:43   ` Junio C Hamano
  2010-06-29  7:47     ` Nazri Ramliy
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2010-06-29  5:43 UTC (permalink / raw)
  To: Nazri Ramliy; +Cc: git

Nazri Ramliy <ayiehere@gmail.com> writes:

> I've tried adding 
>
> 	log --decorate --all --oneline --color=always
>
> to t4013-diff-various.sh but it seems a bit out of place because my test only
> test for colors, while no other test in that file test for colors, hence the
> new test file (t4207-log-decoration-colors.sh).

It sounds fine to have these in a separate file.

> diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
> new file mode 100755
> index 0000000..260e71f
> --- /dev/null
> +++ b/t/t4207-log-decoration-colors.sh
> @@ -0,0 +1,70 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2010 Nazri Ramliy
> +#
> +
> +test_description='Test for "git log --decorate" colors
> +'

Let's not expand a single-line description needlessly into a multi-line
one.

> +. ./test-lib.sh
> +
> +test_expect_success setup '
> +  echo foo > foo.txt &&

Indent these with <TAB>, like:

	echo foo >foo.txt &&

> +  git add foo.txt &&
> +  test_tick &&
> +  git commit -m first &&
> +
> +  echo bar > bar.txt &&
> +  git add bar.txt &&
> +  test_tick &&
> +  git commit -m second &&
> +
> +  test_tick &&
> +  EDITOR=cat git tag v1.0 &&

I think "EDITOR=cat" is doubly wrong.  You are not annotating the tag
anyway, so it won't get called, but if you were, you will get something
like this:

	$ EDITOR=cat git tag -a v1.0

	#
        # Write a tag message
        #
        fatal: no tag message?

> +  git clone . local_clone &&
> +  cd local_clone &&

Do not chdir around inside test scripts without having that in a subshell,
as people typically write "cd .." at the very end of a && chain, which may
not be called when anything in between fails, throwing the later tests
into chaos.

In this case your excuse will be that you will run everything after this
point in that local-clone subdirectory, but still this is not a good style
we would want to keep around, risking to be copied by other people who do
not think carefully.

I think the set-up sequence for this test script should probably be
structured like this:

	get_color()
        {
        	git config ...
	}

	test_expect_success setup '
		git config diff.color.commit yellow &&
                ...
                git config color.decorate.HEAD cyan &&

                c_reset=$(get_color reset) &&
                ...
		c_HEAD=$(get_color cyan) &&

        	test_commit A &&
		git clone . other &&
                (
                	cd other &&
                        test_commit A1
		) &&
		git remote add -f other ./other &&
                test_commit B &&
		git tag v1.0 &&
                echo >>A &&
                git stash save Changes to A &&
	'

so that the main test is done inside the top-level directory (you wanted
the clone only because you wanted to have remote tracking branches, not
because you didn't want to touch the top-level directory).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Add test for correct coloring of git log --decoration
  2010-06-29  5:43   ` Junio C Hamano
@ 2010-06-29  7:47     ` Nazri Ramliy
  2010-06-30 20:37       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Nazri Ramliy @ 2010-06-29  7:47 UTC (permalink / raw)
  To: gitster, git; +Cc: Nazri Ramliy

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
---
On Tue, Jun 29, 2010 at 1:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Let's not expand a single-line description needlessly into a multi-line
> one.

Fixed.

>> +test_expect_success setup '
>> +  echo foo > foo.txt &&
>
> Indent these with <TAB>, like:
>
>        echo foo >foo.txt &&

Fixed.

> I think "EDITOR=cat" is doubly wrong.

Fixed.

> Do not chdir around inside test scripts without having that in a subshell,
> as people typically write "cd .." at the very end of a && chain, which may
> not be called when anything in between fails, throwing the later tests
> into chaos.

Fixed.

> In this case your excuse will be that you will run everything after this
> point in that local-clone subdirectory, but still this is not a good style
> we would want to keep around, risking to be copied by other people who do
> not think carefully.
[snip]
> I think the set-up sequence for this test script should probably be
> structured like this:
[snip]
> so that the main test is done inside the top-level directory (you wanted
> the clone only because you wanted to have remote tracking branches, not
> because you didn't want to touch the top-level directory).

Thanks for taking the time to explain it well.

I should have familiarized myself more with the utility functions in
test-lib.sh (so that I would know about test_commit).

I've updated the test to also test for the need to print 'reset' right before
restoring the commit color.  This is done by setting the tag color to "reverse
bold yellow".  Without the 'reset', the next decoration would be wrongly
printed in reverse.

nazri

 t/t4207-log-decoration-colors.sh |   65 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100755 t/t4207-log-decoration-colors.sh

diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh
new file mode 100755
index 0000000..5ea5865
--- /dev/null
+++ b/t/t4207-log-decoration-colors.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Nazri Ramliy
+#
+
+test_description='Test for "git log --decorate" colors'
+
+. ./test-lib.sh
+
+get_color ()
+{
+	git config --get-color no.such.slot "$1"
+}
+
+test_expect_success setup '
+	git config diff.color.commit yellow &&
+	git config color.decorate.branch green &&
+	git config color.decorate.remoteBranch red &&
+	git config color.decorate.tag "reverse bold yellow" &&
+	git config color.decorate.stash magenta &&
+	git config color.decorate.HEAD cyan &&
+
+	c_reset=$(get_color reset) &&
+
+	c_commit=$(get_color yellow) &&
+	c_branch=$(get_color green) &&
+	c_remoteBranch=$(get_color red) &&
+	c_tag=$(get_color "reverse bold yellow") &&
+	c_stash=$(get_color magenta) &&
+	c_HEAD=$(get_color cyan) &&
+
+	test_commit A &&
+	git clone . other &&
+	(
+		cd other &&
+		test_commit A1
+	) &&
+
+	git remote add -f other ./other &&
+	test_commit B &&
+	git tag v1.0 &&
+	echo >>A.t &&
+	git stash save Changes to A.t
+'
+
+cat > expected << EOF
+${c_commit}COMMIT_ID (${c_HEAD}HEAD${c_reset}${c_commit},\
+ ${c_tag}tag: v1.0${c_reset}${c_commit},\
+ ${c_tag}tag: B${c_reset}${c_commit},\
+ ${c_branch}master${c_reset}${c_commit})${c_reset} B
+${c_commit}COMMIT_ID (${c_tag}tag: A1${c_reset}${c_commit},\
+ ${c_remoteBranch}other/master${c_reset}${c_commit})${c_reset} A1
+${c_commit}COMMIT_ID (${c_stash}refs/stash${c_reset}${c_commit})${c_reset}\
+ On master: Changes to A.t
+${c_commit}COMMIT_ID (${c_tag}tag: A${c_reset}${c_commit})${c_reset} A
+EOF
+
+# We want log to show all, but the second parent to refs/stash is irrelevant
+# to this test since it does not contain any decoration, hence --first-parent
+test_expect_success 'Commit Decorations Colored Correctly' '
+	git log --first-parent --abbrev=10 --all --decorate --oneline --color=always | sed "s/[0-9a-f]\{10,10\}/COMMIT_ID/" > out &&
+	test_cmp expected out
+'
+
+test_done
-- 
1.7.1.245.g7c42e.dirty

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add test for correct coloring of git log --decoration
  2010-06-29  7:47     ` Nazri Ramliy
@ 2010-06-30 20:37       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2010-06-30 20:37 UTC (permalink / raw)
  To: Nazri Ramliy; +Cc: git

Nazri Ramliy <ayiehere@gmail.com> writes:

> I've updated the test to also test for the need to print 'reset' right before
> restoring the commit color.  This is done by setting the tag color to "reverse
> bold yellow".  Without the 'reset', the next decoration would be wrongly
> printed in reverse.

Thanks, will queue.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-30 20:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-27 20:11 What's cooking in git.git (Jun 2010, #05; Sun, 27) Junio C Hamano
2010-06-28  7:30 ` [PATCH] Add test for correct coloring of git log --decoration Nazri Ramliy
2010-06-29  5:43   ` Junio C Hamano
2010-06-29  7:47     ` Nazri Ramliy
2010-06-30 20:37       ` Junio C Hamano

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 NNTP newsgroup(s).