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

Re: git: detect file creator

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 22, 2022, 06:11 UTC
Message-ID
<xmqqpmhxd6cf.fsf@gitster.g>
In-Reply-To
<CA+X_a+zd52cB2h9txxxUeNV0t5s4-ARj+ApDb2+q=MYrY4-dwg@mail.gmail.com>
Sim Tov <smntov@gmail.com> writes:
> PS: the only way I see to approach it is to create a mechanism that
> will prevent renaming
> files by anyone except for the file creator (the one who Added file).
> Can such a commit hook be created? If yes - how?

As Git is distributed, local hooks cannot fundamentally be used as an enforcement mechanism.

How about running "git blame" on the end-result, with -C/-M turned on, instead of paying too much attention to file creation? That way, at least you can trace who contributed the words on each line.

Previous: Sim Tov
Message 6 of 6 in “git: detect file creator”
  1. Sim TovJul 15, 2022
  2. Ævar Arnfjörð BjarmasonJul 15, 2022
  3. Sim TovJul 16, 2022
  4. Sim TovJul 18, 2022
  5. Sim TovJul 18, 2022
  6. Junio C HamanoJul 22, 2022

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.