Re: [PATCH v2] archive: make --add-virtual-file honor --prefix

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

 



Am 17.05.24 um 19:34 schrieb Tom Scogland via GitGitGadget:
> From: Tom Scogland <scogland1@xxxxxxxx>
>
> The documentation for archive describes the `--add-virtual-file` option
> thusly:
>
>   The path of the file in the archive is built by concatenating the
>   value of the last `--prefix` moption (if any) before this
>   `--add-virtual-file` and <path>.

The documentation does not actually misspell "option" as "moption".

> The `--add-file` documentation is similar:
>
>   The path of the file in the archive is built by concatenating the
>   value of the last --prefix option (if any) before this --add-file and
>   the basename of <file>.
>
> Notably both explicitly state that they honor the last `--prefix` option
> before the `--add` option in question.  The implementation of
> `--add-file` seems to have always honored prefix, but the implementation
> of `--add-virtual-file` does not.  Also note that `--add-virtual-file`
> explicitly states it will use the full path given, while `--add-file`
> uses the basename of the path it is given.
>
> Modify archive.c to include the prefix in the path used by
> `--add-virtual-file`

Aligning code and docs is a good idea.  Have you considered keeping the
code as is and changing the documentation instead, though?

The two options are related in that they both add untracked files, but
they necessarily have different arguments:

   --add-file=<file>
   --add-virtual-file=<path>:<content>

You can already specify any path you want with --add-virtual-file.
What's the advantage of honoring --prefix as well?

René






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

  Powered by Linux