Re: Looking for help to understand external filter driver code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 Jul 2016, at 20:53, Junio C Hamano <gitster@xxxxxxxxx> wrote:

> Junio C Hamano <gitster@xxxxxxxxx> writes:
> 
>> The key benefit of this arrangement is the above can be done without
>> having to do poll() to flip between reading and writing that is
>> needed to avoid deadlocking, which kept the code simpler.  A later
>> conversion of the write side into async does not fundamentally
>> change anything from the original arrangement.
> 
> Translation: I was too lazy to worry about doing poll()/select()
> when I did it originally.  As long as you can do so correctly, be my
> guest to reduce one process by having the main process do both
> reading and writing.
> 
> ;-)

Thanks a lot for this explanation. My goal is to add an option to
the clean/smudge filter config that instructs Git to keep the
external filter process running. Whenever Git encounters a file
to be filtered then it would continue to talk to the filter process
over a simple pipe protocol:

Git writes --> 4 byte filename length
Git writes --> filename string
Git writes --> 4 byte content length
Git writes --> content string
Git reads <-- 4 byte filtered content length
Git reads <-- filtered content

I still need to read more about poll()/select() but it looks to me
as if these functions are only required if Git doesn't know what to
expect. With the sketched protocol above that wouldn't be the case.
Therefore, I wonder if I would need to use poll()/select()?

Thanks,
Lars

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]