1. 12 Sep, 2018 1 commit
  2. 15 Aug, 2018 1 commit
  3. 13 Aug, 2018 2 commits
    • Duy Nguyen's avatar
      attr: remove index from git_attr_set_direction() · c4500e25
      Duy Nguyen authored
      Since attr checking API now take the index, there's no need to set an
      index in advance with this call. Most call sites are straightforward
      because they either pass the_index or NULL (which defaults back to
      the_index previously). There's only one suspicious call site in
      unpack-trees.c where it sets a different index.
      This code in unpack-trees is about to check out entries from the
      new/temporary index after merging is done in it. The attributes will
      be used by entry.c code to do crlf conversion if needed. entry.c now
      respects struct checkout's istate field, and this field is correctly
      set in unpack-trees.c, there should be no regression from this change.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
    • Duy Nguyen's avatar
      attr: remove an implicit dependency on the_index · 7a400a2c
      Duy Nguyen authored
      Make the attr API take an index_state instead of assuming the_index in
      attr code. All call sites are converted blindly to keep the patch
      simple and retain current behavior. Individual call sites may receive
      further updates to use the right index instead of the_index.
      There is one ugly temporary workaround added in attr.c that needs some
      more explanation.
      Commit c24f3aba (apply: file commited with CRLF should roundtrip
      diff and apply - 2017-08-19) forces one convert_to_git() call to NOT
      read the index at all. But what do you know, we read it anyway by
      falling back to the_index. When "istate" from convert_to_git is now
      propagated down to read_attr_from_array() we will hit segfault
      somewhere inside read_blob_data_from_index.
      The right way of dealing with this is to kill "use_index" variable and
      only follow "istate" but at this stage we are not ready for that:
      while most git_attr_set_direction() calls just passes the_index to be
      assigned to use_index, unpack-trees passes a different one which is
      used by entry.c code, which has no way to know what index to use if we
      delete use_index. So this has to be done later.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
  4. 03 Aug, 2018 1 commit
  5. 13 Mar, 2017 1 commit
  6. 01 Feb, 2017 10 commits
  7. 28 Mar, 2012 1 commit
  8. 04 Aug, 2011 3 commits
  9. 31 May, 2010 1 commit
    • Gary V. Vaughan's avatar
      enums: omit trailing comma for portability · 4b05548f
      Gary V. Vaughan authored
      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: 's avatarGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: 's avatarJunio C Hamano <gitster@pobox.com>
  10. 17 Jan, 2010 1 commit
  11. 18 Apr, 2009 1 commit
  12. 14 Mar, 2009 1 commit
    • Junio C Hamano's avatar
      Read attributes from the index that is being checked out · 06f33c17
      Junio C Hamano 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: 's avatarJunio C Hamano <gitster@pobox.com>
  13. 18 Apr, 2007 1 commit
    • Junio C Hamano's avatar
      Fix funny types used in attribute value representation · a5e92abd
      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: 's avatarJunio C Hamano <junkio@cox.net>
  14. 17 Apr, 2007 1 commit
    • Junio C Hamano's avatar
      Allow more than true/false to attributes. · 515106fa
      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: 's avatarJunio C Hamano <junkio@cox.net>
  15. 14 Apr, 2007 1 commit
    • Junio C Hamano's avatar
      Add basic infrastructure to assign attributes to paths · d0bfd026
      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: 's avatarJunio C Hamano <junkio@cox.net>