1. 04 1月, 2010 3 次提交
    • J
      Fix bit assignment for CE_CONFLICTED · bf96c931
      Junio C Hamano 提交于
      CE_WT_REMOVE has already grabbed the same value.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bf96c931
    • J
      "reset --merge": fix unmerged case · e11d7b59
      Junio C Hamano 提交于
      Commit 9e8eceab (Add 'merge' mode to 'git reset', 2008-12-01) disallowed
      "git reset --merge" when there was unmerged entries.  But it wished if
      unmerged entries were reset as if --hard (instead of --merge) has been
      used.  This makes sense because all "mergy" operations makes sure that
      any path involved in the merge does not have local modifications before
      starting, so resetting such a path away won't lose any information.
      
      The previous commit changed the behavior of --merge to accept resetting
      unmerged entries if they are reset to a different state than HEAD, but it
      did not reset the changes in the work tree, leaving the conflict markers
      in the resulting file in the work tree.
      
      Fix it by doing three things:
      
       - Update the documentation to match the wish of original "reset --merge"
         better, namely, "An unmerged entry is a sign that the path didn't have
         any local modification and can be safely resetted to whatever the new
         HEAD records";
      
       - Update read_index_unmerged(), which reads the index file into the cache
         while dropping any higher-stage entries down to stage #0, not to copy
         the object name from the higher stage entry.  The code used to take the
         object name from the a stage entry ("base" if you happened to have
         stage #1, or "ours" if both sides added, etc.), which essentially meant
         that you are getting random results depending on what the merge did.
      
         The _only_ reason we want to keep a previously unmerged entry in the
         index at stage #0 is so that we don't forget the fact that we have
         corresponding file in the work tree in order to be able to remove it
         when the tree we are resetting to does not have the path.  In order to
         differentiate such an entry from ordinary cache entry, the cache entry
         added by read_index_unmerged() is marked as CE_CONFLICTED.
      
       - Update merged_entry() and deleted_entry() so that they pay attention to
         cache entries marked as CE_CONFLICTED.  They are previously unmerged
         entries, and the files in the work tree that correspond to them are
         resetted away by oneway_merge() to the version from the tree we are
         resetting to.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e11d7b59
    • S
      reset: use "unpack_trees()" directly instead of "git read-tree" · d0f379c2
      Stephan Beyer 提交于
      This patch makes "reset_index_file()" call "unpack_trees()" directly
      instead of forking and execing "git read-tree". So the code is more
      efficient.
      
      And it's also easier to see which unpack_tree() options will be used,
      as we don't need to follow "git read-tree"'s command line parsing
      which is quite complex.
      
      As Daniel Barkalow found, there is a difference between this new
      version and the old one. The old version gives an error for
      "git reset --merge" with unmerged entries, and the new version does
      not when we reset the entries to some states that differ from HEAD.
      Instead, it resets the index entry and succeeds, while leaving the
      conflict markers in the corresponding file in the work tree (which
      will be corrected by the next patch).
      
      The code comes from the sequencer GSoC project:
      
      git://repo.or.cz/git/sbeyer.git
      
      (at commit 5a78908b70ceb5a4ea9fd4b82f07ceba1f019079)
      Mentored-by: NDaniel Barkalow <barkalow@iabervon.org>
      Mentored-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NStephan Beyer <s-beyer@gmx.net>
      Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d0f379c2
  2. 30 12月, 2009 3 次提交
  3. 24 12月, 2009 3 次提交
  4. 23 12月, 2009 3 次提交
  5. 22 12月, 2009 1 次提交
  6. 21 12月, 2009 8 次提交
  7. 20 12月, 2009 4 次提交
  8. 18 12月, 2009 2 次提交
  9. 17 12月, 2009 5 次提交
    • J
      Git 1.6.6-rc3 · 94058a90
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      94058a90
    • J
      Merge branch 'maint' to sync with 1.6.5.7 · a1bb8f45
      Junio C Hamano 提交于
      * maint:
        Git 1.6.5.7
        worktree: don't segfault with an absolute pathspec without a work tree
        ignore unknown color configuration
        help.autocorrect: do not run a command if the command given is junk
        Illustrate "filter" attribute with an example
      a1bb8f45
    • J
      Git 1.6.5.7 · 527b9d70
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      527b9d70
    • J
      worktree: don't segfault with an absolute pathspec without a work tree · b3100fd5
      Junio C Hamano 提交于
      If a command is run with an absolute path as a pathspec inside a bare
      repository, e.g. "rev-list HEAD -- /home", the code tried to run strlen()
      on NULL, which is the result of get_git_work_tree(), and segfaulted.  It
      should just fail instead.
      
      Currently the function returns NULL even inside .git/ in a repository
      with a work tree, but that is a separate issue.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b3100fd5
    • J
      ignore unknown color configuration · 8b8e8624
      Jeff King 提交于
      When parsing the config file, if there is a value that is
      syntactically correct but unused, we generally ignore it.
      This lets non-core porcelains store arbitrary information in
      the config file, and it means that configuration files can
      be shared between new and old versions of git (the old
      versions might simply ignore certain configuration).
      
      The one exception to this is color configuration; if we
      encounter a color.{diff,branch,status}.$slot variable, we
      die if it is not one of the recognized slots (presumably as
      a safety valve for user misconfiguration). This behavior
      has existed since 801235c5 (diff --color: use
      $GIT_DIR/config, 2006-06-24), but hasn't yet caused a
      problem. No porcelain has wanted to store extra colors, and
      we once a color area (like color.diff) has been introduced,
      we've never changed the set of color slots.
      
      However, that changed recently with the addition of
      color.diff.func. Now a user with color.diff.func in their
      config can no longer freely switch between v1.6.6 and older
      versions; the old versions will complain about the existence
      of the variable.
      
      This patch loosens the check to match the rest of
      git-config; unknown color slots are simply ignored. This
      doesn't fix this particular problem, as the older version
      (without this patch) is the problem, but it at least
      prevents it from happening again in the future.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b8e8624
  10. 16 12月, 2009 1 次提交
    • J
      help.autocorrect: do not run a command if the command given is junk · 06500a02
      Johannes Sixt 提交于
      If a given command is not found, then help.c tries to guess which one the
      user could have meant. If help.autocorrect is 0 or unset, then a list of
      suggestions is given as long as the dissimilarity between the given command
      and the candidates is not excessively high. But if help.autocorrect was
      non-zero (i.e., a delay after which the command is run automatically), the
      latter restriction on dissimilarity was not obeyed.
      
      In my case, this happened:
      
       $ git ..daab02
       WARNING: You called a Git command named '..daab02', which does not exist.
       Continuing under the assumption that you meant 'read-tree'
       in 4.0 seconds automatically...
      
      The patch reuses the similarity limit that is also applied when the list of
      suggested commands is printed.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      06500a02
  11. 15 12月, 2009 1 次提交
  12. 13 12月, 2009 1 次提交
  13. 11 12月, 2009 5 次提交