1. 15 Apr, 2013 1 commit
    • Karsten Blees's avatar
      dir.c: git-status --ignored: don't scan the work tree twice · 0aaf62b6
      Karsten Blees authored
      'git-status --ignored' still scans the work tree twice to collect
      untracked and ignored files, respectively.
      fill_directory / read_directory already supports collecting untracked and
      ignored files in a single directory scan. However, the DIR_COLLECT_IGNORED
      flag to enable this has some git-add specific side-effects (e.g. it
      doesn't recurse into ignored directories, so listing ignored files with
      --untracked=all doesn't work).
      The DIR_SHOW_IGNORED flag doesn't list untracked files and returns ignored
      files in dir_struct.entries[] (instead of dir_struct.ignored[] as
      DIR_COLLECT_IGNORED). DIR_SHOW_IGNORED is used all throughout git.
      We don't want to break the existing API, so lets introduce a new flag
      DIR_SHOW_IGNORED_TOO that lists untracked as well as ignored files similar
      to DIR_COLLECT_FILES, but will recurse into sub-directories based on the
      other flags as DIR_SHOW_IGNORED does.
      In dir.c::read_directory_recursive, add ignored files to either
      dir_struct.entries[] or dir_struct.ignored[] based on the flags. Also move
      the DIR_COLLECT_IGNORED case here so that filling result lists is in a
      common place.
      In wt-status.c::wt_status_collect_untracked, use the new flag and read
      results from dir_struct.ignored[]. Remove the extra fill_directory call.
      builtin/check-ignore.c doesn't call fill_directory, setting the git-add
      specific DIR_COLLECT_IGNORED flag has no effect here. Remove for clarity.
      Update API documentation to reflect the changes.
      Performance: with this patch, 'git-status --ignored' is typically as fast
      as 'git-status'.
      Signed-off-by: default avatarKarsten Blees <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  2. 12 Apr, 2013 4 commits
  3. 07 Apr, 2013 5 commits
  4. 05 Apr, 2013 2 commits
  5. 03 Apr, 2013 6 commits
  6. 02 Apr, 2013 4 commits
  7. 01 Apr, 2013 5 commits
  8. 31 Mar, 2013 1 commit
    • Junio C Hamano's avatar
      peel_onion(): teach $foo^{object} peeler · a6a3f2cc
      Junio C Hamano authored
      A string that names an object can be suffixed with ^{type} peeler to
      say "I have this object name; peel it until you get this type. If
      you cannot do so, it is an error".  v1.8.2^{commit} asks for a commit
      that is pointed at an annotated tag v1.8.2; v1.8.2^{tree} unwraps it
      further to the top-level tree object.  A special suffix ^{} (i.e. no
      type specified) means "I do not care what it unwraps to; just peel
      annotated tag until you get something that is not a tag".
      When you have a random user-supplied string, you can turn it to a
      bare 40-hex object name, and cause it to error out if such an object
      does not exist, with:
      	git rev-parse --verify "$userstring^{}"
      for most objects, but this does not yield the tag object name when
      $userstring refers to an annotated tag.
      Introduce a new suffix, ^{object}, that only makes sure the given
      name refers to an existing object.  Then
      	git rev-parse --verify "$userstring^{object}"
      becomes a way to make sure $userstring refers to an existing object.
      This is necessary because the plumbing "rev-parse --verify" is only
      about "make sure the argument is something we can feed to get_sha1()
      and turn it into a raw 20-byte object name SHA-1" and is not about
      "make sure that 20-byte object name SHA-1 refers to an object that
      exists in our object store".  When the given $userstring is already
      a 40-hex, by definition "rev-parse --verify $userstring" can turn it
      into a raw 20-byte object name.  With "$userstring^{object}", we can
      make sure that the 40-hex string names an object that exists in our
      object store before "--verify" kicks in.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  9. 28 Mar, 2013 1 commit
  10. 27 Mar, 2013 3 commits
  11. 26 Mar, 2013 3 commits
  12. 25 Mar, 2013 3 commits
  13. 21 Mar, 2013 2 commits