Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Mar 28, 2012
  1. @meyering @gitster

    correct a few doubled-word nits in comments and documentation

    meyering authored gitster committed
    Found by running this command:
    $ git ls-files -z|xargs -0 perl -0777 -n \
     -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt]o)\s+\1\b/gims)' \
     -e '  {' \
     -e '    $n = ($` =~ tr/\n/\n/ + 1);' \
     -e '    ($v = $&) =~ s/\n/\\n/g;' \
     -e '    print "$ARGV:$n:$v\n";' \
     -e '  }'
    Why not just git grep -E ...?
    That wouldn't work then the doubled words are separated by a newline.
    This is derived from a Makefile syntax-check rule in gnulib's
    Signed-off-by: Jim Meyering <>
    Signed-off-by: Junio C Hamano <>
Commits on Aug 4, 2011
  1. @mhagger @gitster

    Rename git_checkattr() to git_check_attr()

    mhagger authored gitster committed
    Suggested by: Junio Hamano <>
    Signed-off-by: Michael Haggerty <>
    Signed-off-by: Junio C Hamano <>
  2. @mhagger @gitster

    Allow querying all attributes on a file

    mhagger authored gitster committed
    Add a function, git_all_attrs(), that reports on all attributes that
    are set on a path.
    Signed-off-by: Michael Haggerty <>
    Signed-off-by: Junio C Hamano <>
  3. @mhagger @gitster

    Provide access to the name attribute of git_attr

    mhagger authored gitster committed
    It will be present in any likely future reimplementation, and its
    availability simplifies other code.
    Signed-off-by: Michael Haggerty <>
    Signed-off-by: Junio C Hamano <>
Commits on May 31, 2010
  1. @gitster

    enums: omit trailing comma for portability

    Gary V. Vaughan authored gitster committed
    Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
    5.1 fails to compile git.
    enum style is inconsistent already, with some enums declared on one
    line, some over 3 lines with the enum values all on the middle line,
    sometimes with 1 enum value per line... and independently of that the
    trailing comma is sometimes present and other times absent, often
    mixing with/without trailing comma styles in a single file, and
    sometimes in consecutive enum declarations.
    Clearly, omitting the comma is the more portable style, and this patch
    changes all enum declarations to use the portable omitted dangling
    comma style consistently.
    Signed-off-by: Gary V. Vaughan <>
    Signed-off-by: Junio C Hamano <>
Commits on Jan 17, 2010
  1. @gitster

    git_attr(): fix function signature

    gitster authored
    The function took (name, namelen) as its arguments, but all the public
    callers wanted to pass a full string.
    Demote the counted-string interface to an internal API status, and allow
    public callers to just pass the string to the function.
    Signed-off-by: Junio C Hamano <>
Commits on Apr 18, 2009
  1. @pclouds @gitster

    attr: add GIT_ATTR_INDEX "direction"

    pclouds authored gitster committed
    This instructs attr mechanism, not to look into working .gitattributes
    at all. Needed by tools that does not handle working directory, such
    as "git archive".
    Signed-off-by: Nguyễn Thái Ngọc Duy <>
    Signed-off-by: Junio C Hamano <>
Commits on Mar 14, 2009
  1. @gitster

    Read attributes from the index that is being checked out

    gitster authored
    Traditionally we used .gitattributes file from the work tree if exists,
    and otherwise read from the index as a fallback.  When switching to a
    branch that has an updated .gitattributes file, and entries in it give
    different attributes to other paths being checked out, we should instead
    read from the .gitattributes in the index.
    This breaks a use case of fixing incorrect entries in the .gitattributes
    in the work tree (without adding it to the index) and checking other paths
    out, though.
        $ edit .gitattributes ;# mark foo.dat as binary
        $ rm foo.dat
        $ git checkout foo.dat
    Signed-off-by: Junio C Hamano <>
Commits on Apr 18, 2007
  1. Fix funny types used in attribute value representation

    Junio C Hamano authored
    It was bothering me a lot that I abused small integer values
    casted to (void *) to represent non string values in
    gitattributes.  This corrects it by making the type of attribute
    values (const char *), and using the address of a few statically
    allocated character buffer to denote true/false.  Unset attributes
    are represented as having NULLs as their values.
    Added in-header documentation to explain how git_checkattr()
    routine should be called.
    Signed-off-by: Junio C Hamano <>
Commits on Apr 17, 2007
  1. Allow more than true/false to attributes.

    Junio C Hamano authored
    This allows you to define three values (and possibly more) to
    each attribute: true, false, and unset.
    Typically the handlers that notice and act on attribute values
    treat "unset" attribute to mean "do your default thing"
    (e.g. crlf that is unset would trigger "guess from contents"),
    so being able to override a setting to an unset state is
    actually useful.
     - If you want to set the attribute value to true, have an entry
       in .gitattributes file that mentions the attribute name; e.g.
    	*.o	binary
     - If you want to set the attribute value explicitly to false,
       use '-'; e.g.
    	*.a	-diff
     - If you want to make the attribute value _unset_, perhaps to
       override an earlier entry, use '!'; e.g.
    	*.a	-diff
    	c.i.a	!diff
    This also allows string values to attributes, with the natural
    but you cannot use it, as nobody takes notice and acts on
    it yet.
    Signed-off-by: Junio C Hamano <>
Commits on Apr 14, 2007
  1. Add basic infrastructure to assign attributes to paths

    Junio C Hamano authored
    This adds the basic infrastructure to assign attributes to
    paths, in a way similar to what the exclusion mechanism does
    based on $GIT_DIR/info/exclude and .gitignore files.
    An attribute is just a simple string that does not contain any
    whitespace.  They can be specified in $GIT_DIR/info/attributes
    file, and .gitattributes file in each directory.
    Each line in these files defines a pattern matching rule.
    Similar to the exclusion mechanism, a later match overrides an
    earlier match in the same file, and entries from .gitattributes
    file in the same directory takes precedence over the ones from
    parent directories.  Lines in $GIT_DIR/info/attributes file are
    used as the lowest precedence default rules.
    A line is either a comment (an empty line, or a line that begins
    with a '#'), or a rule, which is a whitespace separated list of
    tokens.  The first token on the line is a shell glob pattern.
    The rest are names of attributes, each of which can optionally
    be prefixed with '!'.  Such a line means "if a path matches this
    glob, this attribute is set (or unset -- if the attribute name
    is prefixed with '!').  For glob matching, the same "if the
    pattern does not have a slash in it, the basename of the path is
    matched with fnmatch(3) against the pattern, otherwise, the path
    is matched with the pattern with FNM_PATHNAME" rule as the
    exclusion mechanism is used.
    This does not define what an attribute means.  Tying an
    attribute to various effects it has on git operation for paths
    that have it will be specified separately.
    Signed-off-by: Junio C Hamano <>
Something went wrong with that request. Please try again.