Feature Request: Option to make "git rev-list --objects" output duplicate objects

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

 



Good afternoon,

While rewriting a slow pre-receive hook to (hopefully) speed it up, I ran into
the following problem:

We want to perform a bunch of checks on all newly pushed files, some of which
are based on the file contents and some of which are based on the file name.
I started with…

  git rev-list --pretty=format:'' --no-commit-header \
  --objects --filter=object:type=blob "$new_head" --not --all

…and then used the resulting list for all subsequent checks. After writing some
unit tests, I noticed that the returned list is not sufficient: If you generate
the exact same file twice, once with a "bad" name and once with a "good" name,
you will only see one of those names and therefore the hook will mistakenly
allow the push.

So, what I would want/need is an option that forces "git rev-list --objects"
to output the object multiple times if it has multiple names in the commit
range. Admittedly, such an option would likely only be useful for hooks that
validate file names.

Would it be feasible to implement such an option? If so, does it sound like a
good or bad idea?

Is there any alternative for my use case that doesn't involve walking the
commits one-by-one? (That's what we previously did and what turned out to be
quite slow on our repository.)

Best regards,
Moritz Baumann




[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