git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] add smudge-to-file and clean-from-file filter configuration

From
Joey Hess <id@joeyh.name>
Date
Jun 17, 2016, 13:13 UTC
Message-ID
<20160617131311.GC24025@kitenet.net>
In-Reply-To
<xmqqy4643ig1.fsf@gitster.mtv.corp.google.com>
Junio C Hamano wrote:
> There is what we would want to fix, though.  "worktree file" should
> be spelled "working tree file". This used not to matter before "git
> worktree" was invented (before that we used these two terms
> interchangeably), but these days the distinction matters.

The existing documentation that I am patching uses the term "worktree file" which is why I continued to use that wording.

(Unless this is a documentation transition that you want to happen peicemeal as documentation is updated for other reasons?)

Show 5 quoted lines
> > +filter.<driver>.clean-from-file::
> 
> Documentation/config.txt hopefully lists all the configuration, but
> I do not see anything that uses 'words-joined-with-dash' format.
> Please do not invent new out-of-convention names.
Point taken; I'll use cleanFromFile and smudgeToFile.

Here's a revised version of the documentation that I think takes the other suggestions onboard. I emphasise that clean and smudge operate as filters, to contrast better with cleanFromFile and smudgeToFile not operating as regular stdio filters.

 filter.<driver>.clean::
-       The command which is used to convert the content of a worktree
+       The command which is used as a filter to convert the content of a worktree
        file to a blob upon checkin.  See linkgit:gitattributes[5] for
        details.
 
 filter.<driver>.smudge::
-       The command which is used to convert the content of a blob
+       The command which is used as a filter to convert the content of a blob
        object to a worktree file upon checkout.  See
        linkgit:gitattributes[5] for details.
 
+filter.<driver>.cleanFromFile::
+       Similar to filter.<driver>.clean but the specified command 
+       directly accesses a worktree file on disk, rather than
+       receiving the file content from standard input. 
+       In the command, "%p" is replaced with the name of the file. 
+       Only used when filter.<driver>.clean is also configured.
+       See linkgit:gitattributes[5] for details.
+
+filter.<driver>.smudgeToFile::
+       Similar to filter.<driver>.smudge but the specified command
+       writes the content of a blob directly to a worktree file,
+       rather than to standard output.
+       In the command, "%p" is replaced with the name of the file.
+       Only used when filter.<driver>.smudge is also configured.
+       See linkgit:gitattributes[5] for details.
+

This could be extended more, but I think this should describe the config settings concisely and point to the more involved discussion of filter drivers in gitattributes.

-- 
see shy jo
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 22 in “extend smudge/clean filters with direct file access”
  1. 0/4 extend smudge/clean filters with direct file accessJoey Hess, Jun 16, 2016
  2. 3/4 use clean-from-file in git addJoey Hess, Jun 16, 2016
  3. 2/4 add smudge-to-file and clean-from-file filter configurationJoey Hess, Jun 16, 2016
  4. Junio C HamanoJun 16, 2016
  5. Joey HessJun 17, 2016
  6. Junio C HamanoJun 17, 2016
  7. Eric SunshineJun 17, 2016
  8. Michael J GruberJun 17, 2016
  9. Joey HessJun 17, 2016
  10. Junio C HamanoJun 17, 2016
  11. Junio C HamanoJun 17, 2016
  12. Joey HessJun 17, 2016
  13. Joey HessJun 17, 2016
  14. Junio C HamanoJun 17, 2016
  15. 1/4 clarify %f documentationJoey Hess, Jun 16, 2016
  16. Junio C HamanoJun 16, 2016
  17. Joey HessJun 17, 2016
  18. Junio C HamanoJun 17, 2016
  19. Joey HessJun 17, 2016
  20. Junio C HamanoJun 17, 2016
  21. 4/4 use smudge-to-file in git checkout etcJoey Hess, Jun 16, 2016
  22. Joey HessJun 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.