Re: [PATCH v2] Add global and system-wide gitattributes

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

 



Petr Onderka <gsvick@xxxxxxxxx> writes:

> Allow gitattributes to be set globally and system wide. This way, settings
> for particular file types can be set in one place and apply for all user's
> repositories.
>
> The location of system-wide attributes file is $(prefix)/etc/gitattributes.
> The location of the global file can be configured by setting
> core.attributesfile.

Good, I like this :-)

> Some parts of the code were copied from the implementation of the same
> functionality in config.c.

(maybe you could say quickly which ones and why)

> +		if (git_attr_global() && attributes_file) {

I tried this, and attributes_file was NULL here. I don't know how it
worked for you, but there should be a call to git_config here.

> +			char *user_attr = xstrdup(attributes_file);
> +
> +			elem = read_attr_from_file(user_attr, 1);
> +			free(user_attr);

Any reason for this xstrdup/free?

Patch follows for these two points + a test, to be squashed into
yours.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]