Re: [PATCH] archive: Refuse to write the archive to a terminal.

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

 



2009/9/16 Mikael Magnusson <mikachu@xxxxxxxxx>:
> 2009/9/16 Johannes Sixt <j.sixt@xxxxxxxxxxxxx>:
>> Josh Triplett schrieb:
>>> I considered adding a -f/--force option, like gzip has, but writing an
>>> archive to a tty seems like a sufficiently insane use case that I'll let
>>> whoever actually needs that write the patch for it. ;)
>>
>> How about '--output -' instead?
>
> You could always just add '|cat'.

Except when running on Windows. Yes MSYS and cygwin provide a version
of cat, but this cannot be guaranteed (e.g. with the series to support
building with MSVC).

The `--output -` / `-o -` syntax looks reasonable (the issue with
using -f/--force is: what are you forcing the operation of?). Is -
used elsewhere in git for specifying stdout?

Also, the die message might be more useful (and in keeping with the
other git commands) by showing the 'inline context help'; something
like:

    Failed to generate the archive: output is a terminal.
    Please specify the file to write to (using `-o archive.tar`) or
redirect the output (e.g. `... | gzip`).
    If you want to write the archive out to the terminal, use `-o -`
to force the operation.

- Reece
--
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]