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

Re: [GSoC][RFC/PATCH] userdiff: added support for diffing shell scripts

From
Christian Couder <christian.couder@gmail.com>
Date
Mar 24, 2019, 09:19 UTC
Message-ID
<CAP8UFD0cWSTZPqqVwTFyYL06S+6aT_EiLPW6jUE0AH9puxevmg@mail.gmail.com>
In-Reply-To
<CAMknYEMBYxp1QJ3Ds9dmuS4ccHKtExx33d_Kv63UOwaUMm5oUQ@mail.gmail.com>
On Sun, Mar 24, 2019 at 9:04 AM Kapil Jain <jkapil.cs@gmail.com> wrote:
Show 11 quoted lines
>
> On Sun, Mar 24, 2019 at 1:34 AM Christian Couder
> <christian.couder@gmail.com> wrote:
> >
> > To save some work by people who could help you, it might be a good
> > idea to show the output of the failing test, for example the output of
> > `./t4034-diff-words.sh -i -v` or `./t4034-diff-words.sh -i -v -x`.
>
> Looks like i just needed to know about -i, -v and -x switches, they
> helped in debugging.
> The problem was with the expect file. It is resolved now.
Great!
> Thanks, will be resubmitting with updated expect file.

It looks like you sent "[GSoC][RFC/PATCH 2/2] userdiff: added shell script support, clears test". I think though that it should have been named "[GSoC][RFC/PATCH v2] userdiff: added shell script support, clears test".

"2/2" means that it is patch number 2 in a patch series that has 2 patches (which should be marked with "1/2" and "2/2"). When resubmitting an already submitted patch (or patch series) we ask for a version number like "v2", "v3", so that we can know that it has already been submitted.

`git format-patch -v 2 ...` will automatically add "v2".
> is the parser used to parse the expect file specific to git ? or is it
> some general one ?

The test_language_driver() function used to test the regexps is defined in t4034-diff-words.sh and it calls the word_diff() function (also defined in t4034-diff-words.sh) which is:

word_diff () {
    test_must_fail git diff --no-index "$@" pre post >output &&
    test_decode_color <output >output.decrypted &&
    test_cmp expect output.decrypted
}

So it uses test_decode_color() and test_cmp() that are defined in t/test-lib-functions.sh. test_cmp() in turn is defined using GIT_TEST_CMP which is usually either "diff -u" or "diff -c".

Previous: Kapil JainNext: Kapil Jain
Message 4 of 9 in “userdiff: added support for diffing shell scripts”
  1. Kapil JainMar 22, 2019
  2. Christian CouderMar 23, 2019
  3. Kapil JainMar 24, 2019
  4. Christian CouderMar 24, 2019
  5. Kapil JainMar 24, 2019
  6. Thomas GummererMar 28, 2019
  7. Kapil JainMar 29, 2019
  8. Thomas GummererMar 29, 2019
  9. [GSoC][RFC/PATCH 2/2] userdiff: added shell script support, clears testKapil Jain, Mar 24, 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.