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

Re: git: detect file creator

From
STSim Tov <smntov@gmail.com>
Date
Jul 18, 2022, 20:12 UTC
Message-ID
<CA+X_a+w-tDv+Qq7dnjSaFrFpYanwBbx77UGFpDinyeWUYQaB2w@mail.gmail.com>
In-Reply-To
<CA+X_a+zbG_CDP6D0zxozRoUmBeWm4dVxQ=xYRqFeWrk+FR5p0g@mail.gmail.com>
Show 15 quoted lines
> Thank you very much, again, for the very useful suggestions!
>
> > > 1. Do you have an idea how can I list all the files **created** (not
> > > authored / committed) by a user, so I can implement a fair characters
> > > counting?
> >
> > If you want to adapt your current script perhaps --diff-filter helps,
> > but...
>
> I added `--diff-filter=AR` to my original command like this:
>
> git log --use-mailmap --no-merges --diff-filter=AR
> --author="CertainEditor" --name-only --pretty=format:""
>
> and it seems to do the job! May I have missed/messed something here?

Now I see that if one editor renames(/moves) the files created by another editor - the former gets credits on all the characters inside those renamed files. This is bad. And it seemingly stems from the fact that in `--diff-filter=AR` means `A` OR `R`. Is there a way to do `A` OR (`A` AND `R`), meaning if a file was renamed then list it only if he also was created by that same author...

Previous: Sim TovNext: Sim Tov
Message 4 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.