1. 08 1月, 2015 1 次提交
  2. 30 12月, 2014 1 次提交
    • J
      is_hfs_dotgit: loosen over-eager match of \u{..47} · 6aaf956b
      Jeff King 提交于
      Our is_hfs_dotgit function relies on the hackily-implemented
      next_hfs_char to give us the next character that an HFS+
      filename comparison would look at. It's hacky because it
      doesn't implement the full case-folding table of HFS+; it
      gives us just enough to see if the path matches ".git".
      
      At the end of next_hfs_char, we use tolower() to convert our
      32-bit code point to lowercase. Our tolower() implementation
      only takes an 8-bit char, though; it throws away the upper
      24 bits. This means we can't have any false negatives for
      is_hfs_dotgit. We only care about matching 7-bit ASCII
      characters in ".git", and we will correctly process 'G' or
      'g'.
      
      However, we _can_ have false positives. Because we throw
      away the upper bits, code point \u{0147} (for example) will
      look like 'G' and get downcased to 'g'. It's not known
      whether a sequence of code points whose truncation ends up
      as ".git" is meaningful in any language, but it does not
      hurt to be more accurate here. We can just pass out the full
      32-bit code point, and compare it manually to the upper and
      lowercase characters we care about.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6aaf956b
  3. 18 12月, 2014 13 次提交
    • J
      Git 1.8.5.6 · 5c8213a7
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5c8213a7
    • J
      Merge branch 'dotgit-case-maint-1.8.5' into maint-1.8.5 · 2aa91008
      Junio C Hamano 提交于
      * dotgit-case-maint-1.8.5:
        fsck: complain about NTFS ".git" aliases in trees
        read-cache: optionally disallow NTFS .git variants
        path: add is_ntfs_dotgit() helper
        fsck: complain about HFS+ ".git" aliases in trees
        read-cache: optionally disallow HFS+ .git variants
        utf8: add is_hfs_dotgit() helper
        fsck: notice .git case-insensitively
        t1450: refactor ".", "..", and ".git" fsck tests
        verify_dotfile(): reject .git case-insensitively
        read-tree: add tests for confusing paths like ".." and ".git"
        unpack-trees: propagate errors adding entries to the index
      2aa91008
    • J
      fsck: complain about NTFS ".git" aliases in trees · d08c13b9
      Johannes Schindelin 提交于
      Now that the index can block pathnames that can be mistaken
      to mean ".git" on NTFS and FAT32, it would be helpful for
      fsck to notice such problematic paths. This lets servers
      which use receive.fsckObjects block them before the damage
      spreads.
      
      Note that the fsck check is always on, even for systems
      without core.protectNTFS set. This is technically more
      restrictive than we need to be, as a set of users on ext4
      could happily use these odd filenames without caring about
      NTFS.
      
      However, on balance, it's helpful for all servers to block
      these (because the paths can be used for mischief, and
      servers which bother to fsck would want to stop the spread
      whether they are on NTFS themselves or not), and hardly
      anybody will be affected (because the blocked names are
      variants of .git or git~1, meaning mischief is almost
      certainly what the tree author had in mind).
      
      Ideally these would be controlled by a separate
      "fsck.protectNTFS" flag. However, it would be much nicer to
      be able to enable/disable _any_ fsck flag individually, and
      any scheme we choose should match such a system. Given the
      likelihood of anybody using such a path in practice, it is
      not unreasonable to wait until such a system materializes.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d08c13b9
    • J
      read-cache: optionally disallow NTFS .git variants · 2b4c6efc
      Johannes Schindelin 提交于
      The point of disallowing ".git" in the index is that we
      would never want to accidentally overwrite files in the
      repository directory. But this means we need to respect the
      filesystem's idea of when two paths are equal. The prior
      commit added a helper to make such a comparison for NTFS
      and FAT32; let's use it in verify_path().
      
      We make this check optional for two reasons:
      
        1. It restricts the set of allowable filenames, which is
           unnecessary for people who are not on NTFS nor FAT32.
           In practice this probably doesn't matter, though, as
           the restricted names are rather obscure and almost
           certainly would never come up in practice.
      
        2. It has a minor performance penalty for every path we
           insert into the index.
      
      This patch ties the check to the core.protectNTFS config
      option. Though this is expected to be most useful on Windows,
      we allow it to be set everywhere, as NTFS may be mounted on
      other platforms. The variable does default to on for Windows,
      though.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2b4c6efc
    • J
      path: add is_ntfs_dotgit() helper · 1d1d69bc
      Johannes Schindelin 提交于
      We do not allow paths with a ".git" component to be added to
      the index, as that would mean repository contents could
      overwrite our repository files. However, asking "is this
      path the same as .git" is not as simple as strcmp() on some
      filesystems.
      
      On NTFS (and FAT32), there exist so-called "short names" for
      backwards-compatibility: 8.3 compliant names that refer to the same files
      as their long names. As ".git" is not an 8.3 compliant name, a short name
      is generated automatically, typically "git~1".
      
      Depending on the Windows version, any combination of trailing spaces and
      periods are ignored, too, so that both "git~1." and ".git." still refer
      to the Git directory. The reason is that 8.3 stores file names shorter
      than 8 characters with trailing spaces. So literally, it does not matter
      for the short name whether it is padded with spaces or whether it is
      shorter than 8 characters, it is considered to be the exact same.
      
      The period is the separator between file name and file extension, and
      again, an empty extension consists just of spaces in 8.3 format. So
      technically, we would need only take care of the equivalent of this
      regex:
              (\.git {0,4}|git~1 {0,3})\. {0,3}
      
      However, there are indications that at least some Windows versions might
      be more lenient and accept arbitrary combinations of trailing spaces and
      periods and strip them out. So we're playing it real safe here. Besides,
      there can be little doubt about the intention behind using file names
      matching even the more lenient pattern specified above, therefore we
      should be fine with disallowing such patterns.
      
      Extra care is taken to catch names such as '.\\.git\\booh' because the
      backslash is marked as a directory separator only on Windows, and we want
      to use this new helper function also in fsck on other platforms.
      
      A big thank you goes to Ed Thomson and an unnamed Microsoft engineer for
      the detailed analysis performed to come up with the corresponding fixes
      for libgit2.
      
      This commit adds a function to detect whether a given file name can refer
      to the Git directory by mistake.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1d1d69bc
    • J
      fsck: complain about HFS+ ".git" aliases in trees · a18fcc9f
      Jeff King 提交于
      Now that the index can block pathnames that case-fold to
      ".git" on HFS+, it would be helpful for fsck to notice such
      problematic paths. This lets servers which use
      receive.fsckObjects block them before the damage spreads.
      
      Note that the fsck check is always on, even for systems
      without core.protectHFS set. This is technically more
      restrictive than we need to be, as a set of users on ext4
      could happily use these odd filenames without caring about
      HFS+.
      
      However, on balance, it's helpful for all servers to block
      these (because the paths can be used for mischief, and
      servers which bother to fsck would want to stop the spread
      whether they are on HFS+ themselves or not), and hardly
      anybody will be affected (because the blocked names are
      variants of .git with invisible Unicode code-points mixed
      in, meaning mischief is almost certainly what the tree
      author had in mind).
      
      Ideally these would be controlled by a separate
      "fsck.protectHFS" flag. However, it would be much nicer to
      be able to enable/disable _any_ fsck flag individually, and
      any scheme we choose should match such a system. Given the
      likelihood of anybody using such a path in practice, it is
      not unreasonable to wait until such a system materializes.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a18fcc9f
    • J
      read-cache: optionally disallow HFS+ .git variants · a42643aa
      Jeff King 提交于
      The point of disallowing ".git" in the index is that we
      would never want to accidentally overwrite files in the
      repository directory. But this means we need to respect the
      filesystem's idea of when two paths are equal. The prior
      commit added a helper to make such a comparison for HFS+;
      let's use it in verify_path.
      
      We make this check optional for two reasons:
      
        1. It restricts the set of allowable filenames, which is
           unnecessary for people who are not on HFS+. In practice
           this probably doesn't matter, though, as the restricted
           names are rather obscure and almost certainly would
           never come up in practice.
      
        2. It has a minor performance penalty for every path we
           insert into the index.
      
      This patch ties the check to the core.protectHFS config
      option. Though this is expected to be most useful on OS X,
      we allow it to be set everywhere, as HFS+ may be mounted on
      other platforms. The variable does default to on for OS X,
      though.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a42643aa
    • J
      utf8: add is_hfs_dotgit() helper · 6162a1d3
      Jeff King 提交于
      We do not allow paths with a ".git" component to be added to
      the index, as that would mean repository contents could
      overwrite our repository files. However, asking "is this
      path the same as .git" is not as simple as strcmp() on some
      filesystems.
      
      HFS+'s case-folding does more than just fold uppercase into
      lowercase (which we already handle with strcasecmp). It may
      also skip past certain "ignored" Unicode code points, so
      that (for example) ".gi\u200ct" is mapped ot ".git".
      
      The full list of folds can be found in the tables at:
      
        https://www.opensource.apple.com/source/xnu/xnu-1504.15.3/bsd/hfs/hfscommon/Unicode/UCStringCompareData.h
      
      Implementing a full "is this path the same as that path"
      comparison would require us importing the whole set of
      tables.  However, what we want to do is much simpler: we
      only care about checking ".git". We know that 'G' is the
      only thing that folds to 'g', and so on, so we really only
      need to deal with the set of ignored code points, which is
      much smaller.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6162a1d3
    • J
      fsck: notice .git case-insensitively · 76e86fc6
      Jeff King 提交于
      We complain about ".git" in a tree because it cannot be
      loaded into the index or checked out. Since we now also
      reject ".GIT" case-insensitively, fsck should notice the
      same, so that errors do not propagate.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      76e86fc6
    • J
      t1450: refactor ".", "..", and ".git" fsck tests · 450870cb
      Jeff King 提交于
      We check that fsck notices and complains about confusing
      paths in trees. However, there are a few shortcomings:
      
        1. We check only for these paths as file entries, not as
           intermediate paths (so ".git" and not ".git/foo").
      
        2. We check "." and ".." together, so it is possible that
           we notice only one and not the other.
      
        3. We repeat a lot of boilerplate.
      
      Let's use some loops to be more thorough in our testing, and
      still end up with shorter code.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      450870cb
    • J
      verify_dotfile(): reject .git case-insensitively · cc2fc7c2
      Jeff King 提交于
      We do not allow ".git" to enter into the index as a path
      component, because checking out the result to the working
      tree may causes confusion for subsequent git commands.
      However, on case-insensitive file systems, ".Git" or ".GIT"
      is the same. We should catch and prevent those, too.
      
      Note that technically we could allow this for repos on
      case-sensitive filesystems. But there's not much point. It's
      unlikely that anybody cares, and it creates a repository
      that is unexpectedly non-portable to other systems.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cc2fc7c2
    • J
      read-tree: add tests for confusing paths like ".." and ".git" · 96b50cc1
      Jeff King 提交于
      We should prevent nonsense paths from entering the index in
      the first place, as they can cause confusing results if they
      are ever checked out into the working tree. We already do
      so, but we never tested it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      96b50cc1
    • J
      unpack-trees: propagate errors adding entries to the index · 46169180
      Jeff King 提交于
      When unpack_trees tries to write an entry to the index,
      add_index_entry may report an error to stderr, but we ignore
      its return value. This leads to us returning a successful
      exit code for an operation that partially failed. Let's make
      sure to propagate this code.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      46169180
  4. 08 10月, 2014 1 次提交
  5. 23 7月, 2014 1 次提交
  6. 17 7月, 2014 1 次提交
  7. 03 7月, 2014 2 次提交
  8. 14 2月, 2014 8 次提交
    • J
      Git 1.8.5.5 · 7bbc4e8f
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7bbc4e8f
    • J
      Merge branch 'bm/merge-base-octopus-dedup' into maint · 2cd86167
      Junio C Hamano 提交于
      "git merge-base --octopus" used to leave cleaning up suboptimal
      result to the caller, but now it does the clean-up itself.
      
      * bm/merge-base-octopus-dedup:
        merge-base --octopus: reduce the result from get_octopus_merge_bases()
        merge-base: separate "--independent" codepath into its own helper
      2cd86167
    • J
      Merge branch 'jc/revision-range-unpeel' into maint · 50320986
      Junio C Hamano 提交于
      "git log --left-right A...B" lost the "leftness" of commits
      reachable from A when A is a tag as a side effect of a recent
      bugfix.  This is a regression in 1.8.4.x series.
      
      * jc/revision-range-unpeel:
        revision: propagate flag bits from tags to pointees
        revision: mark contents of an uninteresting tree uninteresting
      50320986
    • J
      Merge branch 'jk/allow-fetch-onelevel-refname' into maint · c3376848
      Junio C Hamano 提交于
      "git clone" would fail to clone from a repository that has a ref
      directly under "refs/", e.g. "refs/stash", because different
      validation paths do different things on such a refname.  Loosen the
      client side's validation to allow such a ref.
      
      * jk/allow-fetch-onelevel-refname:
        fetch-pack: do not filter out one-level refs
      c3376848
    • J
      Merge branch 'jk/interpret-branch-name-fix' into maint · 21261fab
      Junio C Hamano 提交于
      A handful of bugs around interpreting $branch@{upstream} notation
      and its lookalike, when $branch part has interesting characters,
      e.g. "@", and ":", have been fixed.
      
      * jk/interpret-branch-name-fix:
        interpret_branch_name: find all possible @-marks
        interpret_branch_name: avoid @{upstream} past colon
        interpret_branch_name: always respect "namelen" parameter
        interpret_branch_name: rename "cp" variable to "at"
        interpret_branch_name: factor out upstream handling
      21261fab
    • J
      Merge branch 'rk/send-email-ssl-cert' into maint · 7c9b668b
      Junio C Hamano 提交于
      A recent update to "git send-email" broke platforms where
      /etc/ssl/certs/ directory exists but cannot be used as SSL_ca_path
      (e.g. Fedora rawhide).
      
      * rk/send-email-ssl-cert:
        send-email: /etc/ssl/certs/ directory may not be usable as ca_path
      7c9b668b
    • J
      Merge branch 'sb/repack-in-c' into maint · 90791e34
      Junio C Hamano 提交于
      "git repack --max-pack-size=8g" stopped being parsed correctly when
      the command was reimplemented in C.
      
      * sb/repack-in-c:
        repack: propagate pack-objects options as strings
        repack: make parsed string options const-correct
        repack: fix typo in max-pack-size option
      90791e34
    • J
      Merge branch 'as/tree-walk-fix-aggressive-short-cut' into maint · b4e931d8
      Junio C Hamano 提交于
      The pathspec matching code, while comparing two trees (e.g. "git
      diff A B -- path1 path2") was too aggressive and failed to match
      some paths when multiple pathspecs were involved.
      
      * as/tree-walk-fix-aggressive-short-cut:
        tree_entry_interesting: match against all pathspecs
      b4e931d8
  9. 06 2月, 2014 11 次提交
    • J
      Git 1.8.5.4 · 3330a2c4
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3330a2c4
    • J
      Merge branch 'jc/maint-pull-docfix' into maint · 01a57745
      Junio C Hamano 提交于
      The documentation to "git pull" hinted there is an "-m" option
      because it incorrectly shared the documentation with "git merge".
      
      * jc/maint-pull-docfix:
        Documentation: "git pull" does not have the "-m" option
        Documentation: exclude irrelevant options from "git pull"
      01a57745
    • J
      Merge branch 'ow/stash-with-ifs' into maint · a74a682b
      Junio C Hamano 提交于
      The implementation of 'git stash $cmd "stash@{...}"' did not quote
      the stash argument properly and left it split at IFS whitespace.
      
      * ow/stash-with-ifs:
        stash: handle specifying stashes with $IFS
      a74a682b
    • J
      Merge branch 'js/lift-parent-count-limit' into maint · 3c864743
      Junio C Hamano 提交于
      There is no reason to have a hardcoded upper limit of the number of
      parents for an octopus merge, created via the graft mechanism, but
      there was.
      
      * js/lift-parent-count-limit:
        Remove the line length limit for graft files
      3c864743
    • J
      Merge branch 'nd/add-empty-fix' into maint · ee5788e3
      Junio C Hamano 提交于
      "git add -A" (no other arguments) in a totally empty working tree
      used to emit an error.
      
      * nd/add-empty-fix:
        add: don't complain when adding empty project root
      ee5788e3
    • J
      Merge branch 'bc/log-decoration' into maint · d11ade70
      Junio C Hamano 提交于
      "git log --decorate" did not handle a tag pointed by another tag
      nicely.
      
      * bc/log-decoration:
        log: properly handle decorations with chained tags
      d11ade70
    • J
      Merge branch 'jh/rlimit-nofile-fallback' into maint · 28856247
      Junio C Hamano 提交于
      When we figure out how many file descriptors to allocate for
      keeping packfiles open, a system with non-working getrlimit() could
      cause us to die(), but because we make this call only to get a
      rough estimate of how many is available and we do not even attempt
      to use up all file descriptors available ourselves, it is nicer to
      fall back to a reasonable low value rather than dying.
      
      * jh/rlimit-nofile-fallback:
        get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure
      28856247
    • J
      Merge branch 'jl/commit-v-strip-marker' into maint · a118beed
      Junio C Hamano 提交于
      "git commit -v" appends the patch to the log message before
      editing, and then removes the patch when the editor returned
      control. However, the patch was not stripped correctly when the
      first modified path was a submodule.
      
      * jl/commit-v-strip-marker:
        commit -v: strip diffs and submodule shortlogs from the commit message
      a118beed
    • J
      Merge branch 'tr/send-email-ssl' into maint · ac0835f9
      Junio C Hamano 提交于
      SSL-related options were not passed correctly to underlying socket
      layer in "git send-email".
      
      * tr/send-email-ssl:
        send-email: set SSL options through IO::Socket::SSL::set_client_defaults
        send-email: --smtp-ssl-cert-path takes an argument
        send-email: pass Debug to Net::SMTP::SSL::new
      ac0835f9
    • J
      Merge branch 'tb/clone-ssh-with-colon-for-port' into maint · 1a111957
      Junio C Hamano 提交于
      Remote repository URL expressed in scp-style host:path notation are
      parsed more carefully (e.g. "foo/bar:baz" is local, "[::1]:/~user" asks
      to connect to user's home directory on host at address ::1.
      
      * tb/clone-ssh-with-colon-for-port:
        git_connect(): use common return point
        connect.c: refactor url parsing
        git_connect(): refactor the port handling for ssh
        git fetch: support host:/~repo
        t5500: add test cases for diag-url
        git fetch-pack: add --diag-url
        git_connect: factor out discovery of the protocol and its parts
        git_connect: remove artificial limit of a remote command
        t5601: add tests for ssh
        t5601: remove clear_ssh, refactor setup_ssh_wrapper
      1a111957
    • J
      Merge branch 'nd/transport-positive-depth-only' into maint · bf03d6e9
      Junio C Hamano 提交于
      "git fetch --depth=0" was a no-op, and was silently ignored.
      Diagnose it as an error.
      
      * nd/transport-positive-depth-only:
        clone,fetch: catch non positive --depth option value
      bf03d6e9
  10. 28 1月, 2014 1 次提交