Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

git-gui: add config value gui.diffopts for passing additional diff options #8

Closed
wants to merge 1 commit into from

1 participant

tvogel
tvogel

This patch adds a new field "Additional Diff Parameters" to git gui, together with a corresponding config variable "gui.diffopts" with empty default. The contained parameters are included in the gui's calls to git diff.

My motivation was to be able to pass "-b" or "-w" to diff.

tvogel

Sorry, forgot to sign-off. Will do it again and send the patch to the mailing list. Ignore if you like.

tvogel

Ok, sign-off added and author email corrected.

tvogel tvogel git-gui: add config value gui.diffopts for passing additional diff op…
…tions

Signed-off-by: Tilman Vogel <tilman.vogel@web.de>
379a0a8
tvogel

Sent to git mailing list.

jonseymour jonseymour referenced this pull request from a commit in jonseymour/git
Nguyễn Thái Ngọc Duy pclouds t1510: setup case #8
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9a5976c
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2011/05 #8) abb8411
dscho dscho referenced this pull request from a commit in msysgit/git
Ævar Arnfjörð Bjarmason avar tests: Infrastructure for Git smoke testing
Add the capability to send smoke reports from the Git test suite.

Currently we only notice bugs in the test suite when it's run
manually. Bugs in Git that only occur on obscure platforms or setups
that the core developers aren't using can thus go unnoticed.

This series aims to change that. With it, anyone that's interested in
avoiding bitrot in Git can volunteer to run a smoke tester. A smoke
tester periodically compiles the latest version of Git, runs the test
suite, and submits a report to a central server indicating how the
test run went.

A smoke tester might run something like this in cron:

    #!/bin/sh
    cd ~/g/git
    git fetch
    for branch in maint master next pu; do
        git checkout origin/$i &&
        make clean all &&
        cd t &&
        make smoke_report
    done

The smoker might want to compile git with non-default flags, include
bisecting functionality or run the tests under valgrind. Doing that is
outside the scope of this patch, this just adds a report submission
mechanism. But including a canonical smoke runner is something we'll
want to include eventually.

What this does now is add smoke and smoke_report targets to t/Makefile
(this example only uses a few tests for demonstration):

    $ make clean smoke
    rm -f -r 'trash directory'.* test-results
    rm -f t????/cvsroot/CVSROOT/?*
    rm -f -r valgrind/bin
    rm -f .prove
    perl ./harness --git-version="1.7.2.1.173.gc9b40" \
                    --no-verbose \
                    --archive="test-results/git-smoke.tar.gz" \
                    t0000-basic.sh t0001-init.sh t0002-gitfile.sh t0003-attributes.sh t0004-unwritable.sh t0005-signals.sh t0006-date.sh
    t0000-basic.sh ....... ok
    t0001-init.sh ........ ok
    t0002-gitfile.sh ..... ok
    t0003-attributes.sh .. ok
    t0004-unwritable.sh .. ok
    t0005-signals.sh ..... ok
    t0006-date.sh ........ ok
    All tests successful.

    Test Summary Report
    -------------------
    t0000-basic.sh     (Wstat: 0 Tests: 46 Failed: 0)
      TODO passed:   5
    Files=7, Tests=134,  3 wallclock secs ( 0.06 usr  0.05 sys +  0.23 cusr  1.33 csys =  1.67 CPU)
    Result: PASS

    TAP Archive created at /home/avar/g/git/t/test-results/git-smoke.tar.gz

The smoke target uses TAP::Harness::Archive to aggregate the test
results into a tarball. The tarball contains two things, the output of
every test file that was run, and a metadata file:

Tarball contents:

    $ tar xzvf git-smoke.tar.gz
    t0004-unwritable.sh
    t0001-init.sh
    t0002-gitfile.sh
    t0005-signals.sh
    t0000-basic.sh
    t0003-attributes.sh
    t0006-date.sh
    meta.yml

A test report:

    $ cat t0005-signals.sh
    ok 1 - sigchain works
    # passed all 1 test(s)
    1..1

A metadata file:

    ---
    extra_properties:
    file_attributes:
      -
        description: t0000-basic.sh
        end_time: 1280437324.61398
        start_time: 1280437324.22186
      -
        description: t0001-init.sh
        end_time: 1280437325.12346
        start_time: 1280437324.62393
      -
        description: t0002-gitfile.sh
        end_time: 1280437325.29428
        start_time: 1280437325.13646
      -
        description: t0003-attributes.sh
        end_time: 1280437325.59678
        start_time: 1280437325.30565
      -
        description: t0004-unwritable.sh
        end_time: 1280437325.77376
        start_time: 1280437325.61003
      -
        description: t0005-signals.sh
        end_time: 1280437325.85426
        start_time: 1280437325.78727
      -
        description: t0006-date.sh
        end_time: 1280437326.2362
        start_time: 1280437325.86768
    file_order:
      - t0000-basic.sh
      - t0001-init.sh
      - t0002-gitfile.sh
      - t0003-attributes.sh
      - t0004-unwritable.sh
      - t0005-signals.sh
      - t0006-date.sh
    start_time: 1280437324
    stop_time: 1280437326

The "extra_properties" hash is where we'll stick Git-specific info,
like whether Git was compiled with gettext or the fallback regex
engine, and what branch we're compiling. Currently no metadata like
this is included.

The entire tarball is then submitted to a central smokebox at
smoke.git.nix.is. This is done with curl(1) via the "smoke_report"
target:

    $ make smoke_report
    curl \
                    -H "Expect: " \
                    -F project=Git \
                    -F architecture=x86_64 \
                    -F platform=Linux \
                    -F revision="1.7.2.1.173.gc9b40" \
                    -F report_file=@test-results/git-smoke.tar.gz \
                    http://smoke.git.nix.is/app/projects/process_add_report/1 \
            | grep -v ^Redirecting
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  117k  100    63  100  117k      3   6430  0:00:21  0:00:18  0:00:03     0
    Reported #8 added.

Reports are then made available on the smokebox via a web interface:

    http://smoke.git.nix.is/app/projects/smoke_reports/1

The smoke reports are also mirrored to a Git repository hosted on
GitHub:

    http://github.com/gitsmoke/smoke-reports

The Smolder SQLite database that contains metadata about the reports
is also made available:

    http://github.com/gitsmoke/smoke-database

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
f9033d0
Eduardo R. D'Avila erdavila referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2010/01 #8) 25fdd77
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2011/09 #8) 19f396b
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2011/10 #8) ea64bed
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2011/12 #8) 6a7057e
Ævar Arnfjörð Bjarmason avar referenced this pull request from a commit in TortoiseGit/tgit
Ævar Arnfjörð Bjarmason avar tests: Infrastructure for Git smoke testing
Add the capability to send smoke reports from the Git test suite.

Currently we only notice bugs in the test suite when it's run
manually. Bugs in Git that only occur on obscure platforms or setups
that the core developers aren't using can thus go unnoticed.

This series aims to change that. With it, anyone that's interested in
avoiding bitrot in Git can volunteer to run a smoke tester. A smoke
tester periodically compiles the latest version of Git, runs the test
suite, and submits a report to a central server indicating how the
test run went.

A smoke tester might run something like this in cron:

    #!/bin/sh
    cd ~/g/git
    git fetch
    for branch in maint master next pu; do
        git checkout origin/$i &&
        make clean all &&
        cd t &&
        make smoke_report
    done

The smoker might want to compile git with non-default flags, include
bisecting functionality or run the tests under valgrind. Doing that is
outside the scope of this patch, this just adds a report submission
mechanism. But including a canonical smoke runner is something we'll
want to include eventually.

What this does now is add smoke and smoke_report targets to t/Makefile
(this example only uses a few tests for demonstration):

    $ make clean smoke
    rm -f -r 'trash directory'.* test-results
    rm -f t????/cvsroot/CVSROOT/?*
    rm -f -r valgrind/bin
    rm -f .prove
    perl ./harness --git-version="1.7.2.1.173.gc9b40" \
                    --no-verbose \
                    --archive="test-results/git-smoke.tar.gz" \
                    t0000-basic.sh t0001-init.sh t0002-gitfile.sh t0003-attributes.sh t0004-unwritable.sh t0005-signals.sh t0006-date.sh
    t0000-basic.sh ....... ok
    t0001-init.sh ........ ok
    t0002-gitfile.sh ..... ok
    t0003-attributes.sh .. ok
    t0004-unwritable.sh .. ok
    t0005-signals.sh ..... ok
    t0006-date.sh ........ ok
    All tests successful.

    Test Summary Report
    -------------------
    t0000-basic.sh     (Wstat: 0 Tests: 46 Failed: 0)
      TODO passed:   5
    Files=7, Tests=134,  3 wallclock secs ( 0.06 usr  0.05 sys +  0.23 cusr  1.33 csys =  1.67 CPU)
    Result: PASS

    TAP Archive created at /home/avar/g/git/t/test-results/git-smoke.tar.gz

The smoke target uses TAP::Harness::Archive to aggregate the test
results into a tarball. The tarball contains two things, the output of
every test file that was run, and a metadata file:

Tarball contents:

    $ tar xzvf git-smoke.tar.gz
    t0004-unwritable.sh
    t0001-init.sh
    t0002-gitfile.sh
    t0005-signals.sh
    t0000-basic.sh
    t0003-attributes.sh
    t0006-date.sh
    meta.yml

A test report:

    $ cat t0005-signals.sh
    ok 1 - sigchain works
    # passed all 1 test(s)
    1..1

A metadata file:

    ---
    extra_properties:
    file_attributes:
      -
        description: t0000-basic.sh
        end_time: 1280437324.61398
        start_time: 1280437324.22186
      -
        description: t0001-init.sh
        end_time: 1280437325.12346
        start_time: 1280437324.62393
      -
        description: t0002-gitfile.sh
        end_time: 1280437325.29428
        start_time: 1280437325.13646
      -
        description: t0003-attributes.sh
        end_time: 1280437325.59678
        start_time: 1280437325.30565
      -
        description: t0004-unwritable.sh
        end_time: 1280437325.77376
        start_time: 1280437325.61003
      -
        description: t0005-signals.sh
        end_time: 1280437325.85426
        start_time: 1280437325.78727
      -
        description: t0006-date.sh
        end_time: 1280437326.2362
        start_time: 1280437325.86768
    file_order:
      - t0000-basic.sh
      - t0001-init.sh
      - t0002-gitfile.sh
      - t0003-attributes.sh
      - t0004-unwritable.sh
      - t0005-signals.sh
      - t0006-date.sh
    start_time: 1280437324
    stop_time: 1280437326

The "extra_properties" hash is where we'll stick Git-specific info,
like whether Git was compiled with gettext or the fallback regex
engine, and what branch we're compiling. Currently no metadata like
this is included.

The entire tarball is then submitted to a central smokebox at
smoke.git.nix.is. This is done with curl(1) via the "smoke_report"
target:

    $ make smoke_report
    curl \
                    -H "Expect: " \
                    -F project=Git \
                    -F architecture=x86_64 \
                    -F platform=Linux \
                    -F revision="1.7.2.1.173.gc9b40" \
                    -F report_file=@test-results/git-smoke.tar.gz \
                    http://smoke.git.nix.is/app/projects/process_add_report/1 \
            | grep -v ^Redirecting
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  117k  100    63  100  117k      3   6430  0:00:21  0:00:18  0:00:03     0
    Reported #8 added.

Reports are then made available on the smokebox via a web interface:

    http://smoke.git.nix.is/app/projects/smoke_reports/1

The smoke reports are also mirrored to a Git repository hosted on
GitHub:

    http://github.com/gitsmoke/smoke-reports

The Smolder SQLite database that contains metadata about the reports
is also made available:

    http://github.com/gitsmoke/smoke-database

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
b6b84d1
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/01 #8) 15445e7
Øyvind A. Holm sunny256 referenced this pull request from a commit in sunny256/git
Junio C Hamano gitster What's cooking (2012/02 #8) d1ebe84
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/03 #8) 5b1049d
Jakub Narębski jnareb referenced this pull request from a commit in jnareb/git
Junio C Hamano What's cooking (2012/04 #8) 25f444d
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/06 #8) bc1ab86
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/07 #8) 98c759d
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/08 #8) 29acbf5
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/09 #8) d208190
Jeff King peff referenced this pull request from a commit in peff/git
Jeff King peff What's cooking (2012/10 #8) 8bc2e84
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/11 #8) d4b03c3
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2012/12 #8) 0271b1b
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/01 #8) d93fe0c
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/02 #8) ae46ec3
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/03 #8) cf3e4ee
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/04 #8) 35e1dc2
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/05 #8) 01f7ee5
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/06 #8) e81ad98
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/07 #8) bf8fd10
tacker66 tacker66 referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Øyvind A. Holm sunny256 referenced this pull request from a commit in sunny256/git
jrn jrn What's cooking (2013/09 #8) 27f3d73
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2013/10 #8) 1b91ac6
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
5b16ad9
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
067ec5d
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
82c289c
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
55d1f07
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
bc7979a
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
04065b3
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster Merge branch 'pw/branch-config-message' into jch
Among the many attempts to microproject #8, this seemed to be the
most "done" among the table based ones; I however tend to think
that the original with minimum refactoring would be easier to read.

* pw/branch-config-message:
  install_branch_config(): simplify verbose messages logic

# Conflicts:
# 	branch.c
25a96c9
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2014/03 #8) a8bbd00
Junio C Hamano gitster referenced this pull request from a commit
Junio C Hamano gitster What's cooking (2014/04 #8) 7152a42
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 21, 2011
tvogel tvogel git-gui: add config value gui.diffopts for passing additional diff op…
…tions

Signed-off-by: Tilman Vogel <tilman.vogel@web.de>
379a0a8
This page is out of date. Refresh to see the latest.
4 Documentation/config.txt
@@ -1100,6 +1100,10 @@ gui.diffcontext::
1100 1100 Specifies how many context lines should be used in calls to diff
1101 1101 made by the linkgit:git-gui[1]. The default is "5".
1102 1102
  1103 +gui.diffopts::
  1104 + Specifies additional parameters to pass to diff from
  1105 + linkgit:git-gui[1]. The default is "".
  1106 +
1103 1107 gui.encoding::
1104 1108 Specifies the default encoding to use for displaying of
1105 1109 file contents in linkgit:git-gui[1] and linkgit:gitk[1].
1  git-gui/git-gui.sh
@@ -823,6 +823,7 @@ set default_config(gui.fastcopyblame) false
823 823 set default_config(gui.copyblamethreshold) 40
824 824 set default_config(gui.blamehistoryctx) 7
825 825 set default_config(gui.diffcontext) 5
  826 +set default_config(gui.diffopts) {}
826 827 set default_config(gui.commitmsgwidth) 75
827 828 set default_config(gui.newbranchtemplate) {}
828 829 set default_config(gui.spellingdictionary) {}
1  git-gui/lib/diff.tcl
@@ -295,6 +295,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
295 295
296 296 lappend cmd -p
297 297 lappend cmd --color
  298 + set cmd [concat $cmd $repo_config(gui.diffopts)]
298 299 if {$repo_config(gui.diffcontext) >= 1} {
299 300 lappend cmd "-U$repo_config(gui.diffcontext)"
300 301 }
1  git-gui/lib/option.tcl
@@ -153,6 +153,7 @@ proc do_options {} {
153 153 {i-20..200 gui.copyblamethreshold {mc "Minimum Letters To Blame Copy On"}}
154 154 {i-0..300 gui.blamehistoryctx {mc "Blame History Context Radius (days)"}}
155 155 {i-1..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
  156 + {t gui.diffopts {mc "Additional Diff Parameters"}}
156 157 {i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
157 158 {t gui.newbranchtemplate {mc "New Branch Name Template"}}
158 159 {c gui.encoding {mc "Default File Contents Encoding"}}

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.