1. 10 2月, 2011 1 次提交
    • J
      fast-import: introduce "feature notes" command · 547e8b92
      Jonathan Nieder 提交于
      Here is a 'feature' command for streams to use to require support for
      the notemodify (N) command.
      
      When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
      2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
      2009-10-09) and it was not obvious it deserved to be a named feature.
      But now that is clear, since all major non-git fast-import backends
      lack support for it.
      
      Details: on git version with this patch applied, any "feature notes"
      command in the features/options section at the beginning of a stream
      will be treated as a no-op.  On fast-import implementations without
      the feature (and older git versions), the command instead errors out
      with a message like
      
      	This version of fast-import does not support feature notes.
      
      So by declaring use of notes at the beginning of a stream, frontends
      can avoid wasting time and other resources when the backend does not
      support notes.  (This would be especially important for backends that
      do not support rewinding history after a botched import.)
      Improved-by: NThomas Rast <trast@student.ethz.ch>
      Improved-by: NSverre Rabbelier <srabbelier@gmail.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      547e8b92
  2. 28 1月, 2011 1 次提交
    • J
      fast-import: treat filemodify with empty tree as delete · 8fe533f6
      Jonathan Nieder 提交于
      Normal git processes do not allow one to build a tree with an empty
      subtree entry without trying hard at it.  This is in keeping with the
      general UI philosophy: git tracks content, not empty directories.
      
      v1.7.3-rc0~75^2 (2010-06-30) changed that by making it easy to include
      an empty subtree in fast-import's active commit:
      
      	M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 subdir
      
      One can trigger this by reading an empty tree (for example, the tree
      corresponding to an empty root commit) and trying to move it to a
      subtree.  It is better and more closely analogous to 'git read-tree
      --prefix' to treat such commands as requests to remove the subtree.
      Noticed-by: NDavid Barr <david.barr@cordelta.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8fe533f6
  3. 02 12月, 2010 3 次提交
  4. 25 11月, 2010 2 次提交
  5. 21 10月, 2010 1 次提交
  6. 19 10月, 2010 2 次提交
    • J
      fast-import: tighten M 040000 syntax · 34215783
      Jonathan Nieder 提交于
      When tree_content_set() is asked to modify the path "foo/bar/",
      it first recurses like so:
      
      	tree_content_set(root, "foo/bar/", sha1, S_IFDIR) ->
      	 tree_content_set(root:foo, "bar/", ...) ->
      	  tree_content_set(root:foo/bar, "", ...)
      
      And as a side-effect of 2794ad52 (fast-import: Allow filemodify to set
      the root, 2010-10-10), this last call is accepted and changes
      the tree entry for root:foo/bar to refer to the specified tree.
      
      That seems safe enough but let's reject the new syntax (we never meant
      to support it) and make it harder for frontends to introduce pointless
      incompatibilities with git fast-import 1.7.3.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      34215783
    • J
      fast-import: filemodify after M 040000 <tree> "" crashes · 5edde510
      Jonathan Nieder 提交于
      Until M 040000 <tree> "" syntax was introduced in commit 2794ad52
      (fast-import: Allow filemodify to set the root, 2010-10-10), it
      was impossible for the root entry to refer to an unloaded tree.
      Update various functions to take that possibility into account.
      Otherwise
      
      	M 040000 <tree> ""
      	M 100644 :1 "foo"
      
      and similar commands (using D, C, or R after resetting the root
      tree) segfault.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5edde510
  7. 14 10月, 2010 1 次提交
    • D
      fast-import: Allow filemodify to set the root · 2794ad52
      David Barr 提交于
      v1.7.3-rc0~75^2 (Teach fast-import to import subtrees named by tree id,
      2010-06-30) has a shortcoming - it doesn't allow the root to be set.
      Extend this behaviour by allowing the root to be referenced as the
      empty path, "".
      
      For a command (like filter-branch --subdirectory-filter) that wants
      to commit a lot of trees that already exist in the object db, writing
      undeltified objects as loose files only to repack them later can
      involve a significant amount of overhead.
      (23% slow-down observed on Linux 2.6.35, worse on Mac OS X 10.6)
      
      Fortunately we have fast-import (which is one of the only git commands
      that will write to a pack directly) but there is not an advertised way
      to tell fast-import to commit a given tree without unpacking it.
      
      This patch changes that, by allowing
      
      	M 040000 <tree id> ""
      
      as a filemodify line in a commit to reset to a particular tree without
      any need to parse it.  For example,
      
      	M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 ""
      
      is a synonym for the deleteall command and the fast-import equivalent of
      
      	git read-tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
      Signed-off-by: NDavid Barr <david.barr@cordelta.com>
      Commit-message-by: NJonathan Nieder <jrnieder@gmail.com>
      Acked-by: NSverre Rabbelier <srabbelier@gmail.com>
      Tested-by: NRamkumar Ramachandra <artagnon@gmail.com>
      Signed-off-by: NRamkumar Ramachandra <artagnon@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2794ad52
  8. 09 10月, 2010 1 次提交
  9. 07 10月, 2010 1 次提交
  10. 12 8月, 2010 1 次提交
  11. 10 7月, 2010 1 次提交
    • E
      fast-import: Improve robustness when D->F changes provided in wrong order · 253fb5f8
      Elijah Newren 提交于
      When older versions of fast-export came across a directory changing to a
      symlink (or regular file), it would output the changes in the form
        M 120000 :239821 dir-changing-to-symlink
        D dir-changing-to-symlink/filename1
      When fast-import sees the first line, it deletes the directory named
      dir-changing-to-symlink (and any files below it) and creates a symlink in
      its place.  When fast-import came across the second line, it was previously
      trying to remove the file and relevant leading directories in
      tree_content_remove(), and as a side effect it would delete the symlink
      that was just created.  This resulted in the symlink silently missing from
      the resulting repository.
      
      To improve robustness, we ignore file deletions underneath directory names
      that correspond to non-directories.  This can also be viewed as a minor
      optimization: since there cannot be a file and a directory with the same
      name in the same directory, the file clearly can't exist so nothing needs
      to be done to delete it.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      253fb5f8
  12. 06 7月, 2010 1 次提交
  13. 12 6月, 2010 1 次提交
  14. 01 6月, 2010 1 次提交
    • G
      enums: omit trailing comma for portability · 4b05548f
      Gary V. Vaughan 提交于
      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: NGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4b05548f
  15. 01 4月, 2010 1 次提交
  16. 07 3月, 2010 1 次提交
  17. 18 2月, 2010 7 次提交
  18. 05 2月, 2010 2 次提交
  19. 02 2月, 2010 1 次提交
  20. 15 1月, 2010 1 次提交
  21. 01 1月, 2010 1 次提交
  22. 08 12月, 2009 1 次提交
    • J
      fast-import: Proper notes tree manipulation · 2a113aee
      Johan Herland 提交于
      This patch teaches 'git fast-import' to automatically organize note objects
      in a fast-import stream into an appropriate fanout structure. The notes API
      in notes.h is NOT used to accomplish this, because trying to keep the
      fast-import and notes data structures in sync would yield a significantly
      larger patch with higher complexity.
      
      Note objects are added with the 'N' command, and accounted for with a
      per-branch counter, which is used to trigger fanout restructuring when
      needed. Note that when restructuring the branch tree, _any_ entry whose
      path consists of 40 hex chars (not including directory separators) will
      be recognized as a note object. It is therefore not advisable to
      manipulate note entries with M/D/R/C commands.
      
      Since note objects are stored in the same tree structure as other objects,
      the unloading and reloading of a fast-import branches handle note objects
      transparently.
      
      This patch has been improved by the following contributions:
      - Shawn O. Pearce: Several style- and logic-related improvements
      
      Cc: Shawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2a113aee
  23. 06 12月, 2009 1 次提交
    • S
      fast-import: add (non-)relative-marks feature · bc3c79ae
      Sverre Rabbelier 提交于
      After specifying 'feature relative-marks' the paths specified with
      'feature import-marks' and 'feature export-marks' are relative to an
      internal directory in the current repository.
      
      In git-fast-import this means that the paths are relative to the
      '.git/info/fast-import' directory. However, other importers may use a
      different location.
      
      Add 'feature non-relative-marks' to disable this behavior, this way
      it is possible to, for example, specify the import-marks location as
      relative, and the export-marks location as non-relative.
      
      Also add tests to verify this behavior.
      
      Cc: Daniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NSverre Rabbelier <srabbelier@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bc3c79ae
  24. 05 12月, 2009 5 次提交
  25. 11 11月, 2009 1 次提交