threads / discuss / 13901

Porcelain/Plumbing

Subject: Porcelain/Plumbing

## tl;dr

2 messages between Jun 11, 2008 and Jun 11, 2008.

replies: 1people: 2as markdown or json

Sverre Rabbelier· Jun 11, 2008, 19:50 UTC · lore
Heya,

During my efforts gsoc efforts, I stumbled across (or actually, was pointed at) 'git branch --contains' to list only branches that contain a specific commit. The problem here is that 'git branch' is listed as porcelain, and that there seems to be no plumbing equivalent of this feature. I have the same problem with 'git log -S', although 'git log' is pretty sturdy output wise (if you specify the output with '--pretty=format:' that is), the idea is the same. My question is, is it intentional that there is no plumbing equivalent forsome functionality, and, in such cases, is it 'ok' to use the porcelain from a script? (I think it is not.) I've been recommended to stick with the plumbing as much as possible from my code, but with the above two cases I've been unsure on what to do. What is the advised course of action here?

-- 
Cheers,

Sverre Rabbelier
Jakub Narebski· Jun 11, 2008, 20:42 UTC · re: Sverre Rabbelier · lore

Re: Porcelain/Plumbing

"Sverre Rabbelier" <alturin@gmail.com> writes:
Show 5 quoted lines
> During my efforts gsoc efforts, I stumbled across (or actually, was
> pointed at) 'git branch --contains' to list only branches that contain
> a specific commit. The problem here is that 'git branch' is listed as
> porcelain, and that there seems to be no plumbing equivalent of this
> feature. 

I think there isn't. If there were, its place probably would be either in git-show-ref, or in git-for-each-ref, or in both.

> I have the same problem with 'git log -S', although 'git log'
> is pretty sturdy output wise (if you specify the output with
> '--pretty=format:' that is), the idea is the same.

log = rev-list + diff-tree. The -S (aka. pickaxe) option is option to git-diff-tree (and friends). You would have to pipe output of rev-list to diff-tree (via --stdin) to use -S in porcelain.

Show 6 quoted lines
> My question is, is it intentional that there is no plumbing equivalent
> forsome functionality, and, in such cases, is it 'ok' to use the
> porcelain from a script? (I think it is not.) I've been recommended to
> stick with the plumbing as much as possible from my code, but with the
> above two cases I've been unsure on what to do.
> What is the advised course of action here?

I think using git-log from scripts is O.K., for example qgit uses git-log to parse revisions, and IIRC it was recommended on git mailing list to do that (IIRC it was around adding --encoding=<encoding> and logOutputEncoding to git).

git-branch I think is too much a porcelain...
-- 
Jakub Narebski
Poland
ShadeHawk on #git

← back to recent threads