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

Re: [PATCH v1 2/2] git-p4: suppress non test relevant output

From
Luke Diamand <luke@diamand.org>
Date
Dec 24, 2015, 11:09 UTC
Message-ID
<567BD26F.3020006@diamand.org>
In-Reply-To
<0185CA76-DDEE-4E7F-8EFF-65E80720E0AF@gmail.com>
On 22/12/15 08:47, Lars Schneider wrote:
>
> On 21 Dec 2015, at 21:38, Junio C Hamano <gitster@pobox.com> wrote:
>
Show 37 quoted lines
>>
>> If so, why not do it there instead?  You seem to run only "kill" to
>> send some signal to a process using this helper function, and it
>> would be silent on its standard output stream (even though it may
>> say "no such process" etc. on its standard error), so it is not
>> clear to me what you are doing with this change here...
>
> If I run git-p4 tests in verbose mode (e.g. "./t9823-git-p4-mock-lfs.sh -v") without this patch then the last lines of the output look like this:
>
>>>> Output Start >>>
> expecting success:
> 	kill_p4d
>
> ./lib-git-p4.sh: line 172: 26289 Killed: 9               while true; do
>      if test $(time_in_seconds) -gt $timeout; then
>          kill -9 $pid; exit 1;
>      fi; sleep 1;
> done
> ok 8 - kill p4d
>
> # passed all 8 test(s)
> 1..8
> <<< Output end <<<
>
> However, I want them to look like this:
>
>>>> Output Start >>>
> expecting success:
> 	kill_p4d
>
> ok 8 - kill p4d
>
> # passed all 8 test(s)
> 1..8
> <<< Output end <<<
>
> This is achieved with the patch. I am no shell expert ... is there a nicer way to achieve the same?
I get your desired output with the unmodified code from origin/next:
$ ./t9823-git-p4-mock-lfs.sh -v
expecting success:
	kill_p4d
ok 8 - kill p4d

# passed all 8 test(s) 1..8

But that's because my shell is symlinked to /bin/dash. I suspect you are using bash - when I run this with bash I get your command output. Possibly a bash bug?

As Junio says, it seems a bit weird that we have to redirect the stderr of that entire expression.

Luke
Previous: Lars SchneiderNext: Junio C Hamano
Message 6 of 8 in “git-p4: kill watchdog and suppress irrelevant output”
  1. 0/2 git-p4: kill watchdog and suppress irrelevant outputlarsxschneider@gmail.com, Dec 20, 2015
  2. 1/2 git-p4: kill p4d watchdog on cleanuplarsxschneider@gmail.com, Dec 20, 2015
  3. 2/2 git-p4: suppress non test relevant outputlarsxschneider@gmail.com, Dec 20, 2015
  4. Junio C HamanoDec 21, 2015
  5. Lars SchneiderDec 22, 2015
  6. Luke DiamandDec 24, 2015
  7. Junio C HamanoDec 21, 2015
  8. Lars SchneiderDec 22, 2015

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.