Re: [PATCH 2/4] add -u: get rid of "treewideupdate" configuration

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

 



Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> writes:

> The intention is good, but reality may need more work.

Yes, I knew about "add -u", as I was touching in its neighbourhood
recently.  The way "git grep" does this may be more appropriate as a short
term solution.

The updated init_pathspec() should at least take (prefix, argc, argv[]),
and in addition a hint as to what to do when there is no pathspec from the
command line (i.e. argc == 0), so that it can behave differently when the
user gave only ":".

By the way, the field in "struct pathspec_item" would need to be updated,
and the matcher would need to be changed, so that each item knows up to
which part of the "match" string came from the prefix (and remainder is a
user supplied pattern).  Then from a subdirectory a?a/bbb,

  - "c" should parse into prefix "a?a/bbb/" plus pattern "c"

  - ":../c" should become prefix "a?a/" plus pattern "c"

and the matcher should match the prefix part _literally_ without
fnmatch(3), while using whatever magic (e.g. use_wildcard) to match the
pattern part.  I think we currently match the whole thing with fnmatch(3),
which in practice may be OK only because not many people use glob
characters in their directory names, but what the current matcher does
logically is wrong.

Of course, both of the above are tasks after 1.7.5 ships, but I thought I
should mention them now, as you seem to be already thinking about the
future.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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