Re: [PATCH] add --porcelain option to git-push

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] add --porcelain option to git-push

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:59

Marc Branchaud [off-list ref] writes:
Shouldn't this option be named "--plumbing" since it's making 'git push'
act like plumbing?  Actually, neither name seems intuitively descriptive
to me...
Perhaps.  But asking for output format designed for Porcelain
implementions to read with --porcelain option has precedence.
Why not teach 'git push' to change its output format if it's writing to a pipe?
That is ugly.  Besides, "writing to a pipe" would not be a right criteria,
if you want to do

          git push >log
          if grep blah log
          then
                do blah thing
          fi
          if grep baa log
          then
                do baa thing, too
          fi

When you make a program behave differently depending on where your stdout
goes, typically you see if it is going to the terminal (e.g. isatty(3)),
but even then you would need an explicit override from the command line
when stdout is a tty and you do not want "for humans" frills (e.g. color),
and when stdout is not a tty and you do want such frills.

Re: [PATCH] add --porcelain option to git-push

From: Marc Branchaud <hidden>
Date: 2016-06-15 22:46:59

Both good points.  --porcelain is fine by me.

		M.


Junio C Hamano wrote:
Marc Branchaud [off-list ref] writes:
quoted
Shouldn't this option be named "--plumbing" since it's making 'git push'
act like plumbing?  Actually, neither name seems intuitively descriptive
to me...
Perhaps.  But asking for output format designed for Porcelain
implementions to read with --porcelain option has precedence.
quoted
Why not teach 'git push' to change its output format if it's writing to a pipe?
That is ugly.  Besides, "writing to a pipe" would not be a right criteria,
if you want to do

          git push >log
          if grep blah log
          then
                do blah thing
          fi
          if grep baa log
          then
                do baa thing, too
          fi

When you make a program behave differently depending on where your stdout
goes, typically you see if it is going to the terminal (e.g. isatty(3)),
but even then you would need an explicit override from the command line
when stdout is a tty and you do not want "for humans" frills (e.g. color),
and when stdout is not a tty and you do want such frills.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help