1. 08 3月, 2013 1 次提交
  2. 05 6月, 2012 1 次提交
    • J
      tweak "bundle verify" of a complete history · 8c3710fd
      Junio C Hamano 提交于
      A bundle that records a complete history without prerequiste is a
      useful way to sneakernet the sources of your configuration files
      under your home directory, etc.  E.g.
      
          $ GIT_DIR=/srv/git/homesrc.git git bundle create x.bndl HEAD master
      
      Running "git bundle verify" on such a "complete" bundle, however,
      gives somewhat a funny output.
      
          $ git bundle verify x.bndl
          The bundle contains 2 refs
          b2611f37ebc7ed6435a72d77fbc5f8b48a7d7146 HEAD
          b2611f37ebc7ed6435a72d77fbc5f8b48a7d7146 refs/heads/master
          The bundle requires these 0 refs
          x.bndl is okay
      
      Reword "requires these 0 refs" to say "The bundle records a complete
      history" instead.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8c3710fd
  3. 26 4月, 2012 1 次提交
    • J
      bundle: remove stray single-quote from error message · 97afde15
      Jonathan Nieder 提交于
      After running rev-list --boundary to retrieve the list of boundary
      commits, "git bundle create" runs its own revision walk.  If in this
      stage git encounters an unfamiliar option, it writes a message with an
      unbalanced quotation mark:
      
      	error: unrecognized argument: --foo'
      
      Drop the stray quote to match the "unrecognized argument: %s" message
      used elsewhere and save translators some work.
      
      This is mostly a futureproofing measure: for now, the "rev-list
      --boundary" command catches most strange arguments on its own and the
      above message is not seen unless you try something esoteric like "git
      bundle create test.bundle --header HEAD".
      Reported-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      97afde15
  4. 25 4月, 2012 1 次提交
  5. 02 3月, 2012 1 次提交
    • T
      bundle: keep around names passed to add_pending_object() · efe4be12
      Thomas Rast 提交于
      The 'name' field passed to add_pending_object() is used to later
      deduplicate in object_array_remove_duplicates().
      
      git-bundle had a bug in this area since 18449ab0 (git-bundle: avoid
      packing objects which are in the prerequisites, 2007-03-08): it passed
      the name of each boundary object in a static buffer.  In other words,
      all that object_array_remove_duplicates() saw was the name of the
      *last* added boundary object.
      
      The recent switch to a strbuf in bc2fed49 (bundle: use a strbuf to scan
      the log for boundary commits, 2012-02-22) made this slightly worse: we
      now free the buffer at the end, so it is not even guaranteed that it
      still points into addressable memory by the time object_array_remove_
      duplicates looks at it.  On the plus side however, it was now
      detectable by valgrind.
      
      The fix is easy: pass a copy of the string to add_pending_object.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      efe4be12
  6. 24 2月, 2012 1 次提交
    • T
      bundle: use a strbuf to scan the log for boundary commits · bc2fed49
      Thomas Rast 提交于
      The first part of the bundle header contains the boundary commits, and
      could be approximated by
      
        # v2 git bundle
        $(git rev-list --pretty=oneline --boundary <ARGS> | grep ^-)
      
      git-bundle actually spawns exactly this rev-list invocation, and does
      the grepping internally.
      
      There was a subtle bug in the latter step: it used fgets() with a
      1024-byte buffer.  If the user has sufficiently long subjects (e.g.,
      by not adhering to the git oneline-subject convention in the first
      place), the 'oneline' format can easily overflow the buffer.  fgets()
      then returns the rest of the line in the next call(s).  If one of
      these remaining parts started with '-', git-bundle would mistakenly
      insert it into the bundle thinking it was a boundary commit.
      
      Fix it by using strbuf_getwholeline() instead, which handles arbitrary
      line lengths correctly.
      
      Note that on the receiving side in parse_bundle_header() we were
      already using strbuf_getwholeline_fd(), so that part is safe.
      Reported-by: NJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bc2fed49
  7. 23 2月, 2012 1 次提交
  8. 04 1月, 2012 1 次提交
  9. 14 11月, 2011 1 次提交
  10. 14 10月, 2011 2 次提交
    • J
      bundle: add parse_bundle_header() helper function · 2727b71f
      Junio C Hamano 提交于
      Move most of the code from read_bundle_header() to parse_bundle_header()
      that takes a file descriptor that is already opened for reading, and make
      the former responsible only for opening the file and noticing errors.
      
      As a logical consequence of this, is_bundle() helper function can be
      implemented as a non-complaining variant of read_bundle_header() that
      does not return an open file descriptor, and can be used to tighten
      the check used to decide the use of bundle transport in transport_get()
      function.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2727b71f
    • J
      bundle: allowing to read from an unseekable fd · e9ee84cf
      Junio C Hamano 提交于
      We wished that "git bundle" to eventually learn to read from a network
      socket which is not seekable. The current code opens with fopen(), reads
      the file halfway and run ftell(), and reopens the same file with open()
      and seeks, to skip the header.
      
      This patch by itself does not reach that goal yet, but I think it is a
      right step in that direction.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e9ee84cf
  11. 04 10月, 2011 2 次提交
  12. 20 9月, 2011 1 次提交
    • J
      Teach progress eye-candy to fetch_refs_from_bundle() · be042aff
      Junio C Hamano 提交于
      With the usual "git" transport, a large-ish transfer with "git fetch" and
      "git pull" give progress eye-candy to avoid boring users.  However, not
      when they are reading from a bundle. I.e.
      
          $ git pull ../git-bundle.bndl master
      
      This teaches bundle.c:unbundle() to give "-v" option to index-pack and
      tell it to give progress bar when transport decides it is necessary.
      
      The operation in the other direction, "git bundle create", could also
      learn to honor --quiet but that is a separate issue.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      be042aff
  13. 07 2月, 2011 1 次提交
  14. 28 8月, 2010 1 次提交
  15. 24 11月, 2009 1 次提交
    • N
      pack-objects: split implications of --all-progress from progress activation · 4f366275
      Nicolas Pitre 提交于
      Currently the --all-progress flag is used to use force progress display
      during the writing object phase even if output goes to stdout which is
      primarily the case during a push operation.  This has the unfortunate
      side effect of forcing progress display even if stderr is not a
      terminal.
      
      Let's introduce the --all-progress-implied argument which has the same
      intent except for actually forcing the activation of any progress
      display.  With this, progress display will be automatically inhibited
      whenever stderr is not a terminal, or full progress display will be
      included otherwise.  This should let people use 'git push' within a cron
      job without filling their logs with useless percentage displays.
      Signed-off-by: NNicolas Pitre <nico@fluxnic.net>
      Tested-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f366275
  16. 21 11月, 2009 1 次提交
    • J
      Teach --stdin option to "log" family · 8b3dce56
      Junio C Hamano 提交于
      Move the logic to read revs from standard input that rev-list knows about
      from it to revision machinery, so that all the users of setup_revisions()
      can feed the list of revs from the standard input when "--stdin" is used
      on the command line.
      
      Allow some users of the revision machinery that want different semantics
      from the "--stdin" option to disable it by setting an option in the
      rev_info structure.
      
      This also cleans up the kludge made to bundle.c via cut and paste.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b3dce56
  17. 13 9月, 2009 1 次提交
  18. 21 5月, 2009 1 次提交
  19. 18 1月, 2009 1 次提交
  20. 06 1月, 2009 1 次提交
  21. 12 11月, 2008 1 次提交
  22. 20 10月, 2008 1 次提交
  23. 07 7月, 2008 1 次提交
  24. 24 2月, 2008 2 次提交
    • J
      start_command(), if .in/.out > 0, closes file descriptors, not the callers · c20181e3
      Johannes Sixt 提交于
      Callers of start_command() can set the members .in and .out of struct
      child_process to a value > 0 to specify that this descriptor is used as
      the stdin or stdout of the child process.
      
      Previously, if start_command() was successful, this descriptor was closed
      upon return. Here we now make sure that the descriptor is also closed in
      case of failures. All callers are updated not to close the file descriptor
      themselves after start_command() was called.
      
      Note that earlier run_gpg_verify() of git-verify-tag set .out = 1, which
      worked because start_command() treated this as a special case, but now
      this is incorrect because it closes the descriptor. The intent here is to
      inherit stdout to the child, which is achieved by .out = 0.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c20181e3
    • J
      start_command(), .in/.out/.err = -1: Callers must close the file descriptor · e72ae288
      Johannes Sixt 提交于
      By setting .in, .out, or .err members of struct child_process to -1, the
      callers of start_command() can request that a pipe is allocated that talks
      to the child process and one end is returned by replacing -1 with the
      file descriptor.
      
      Previously, a flag was set (for .in and .out, but not .err) to signal
      finish_command() to close the pipe end that start_command() had handed out,
      so it was optional for callers to close the pipe, and many already do so.
      Now we make it mandatory to close the pipe.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e72ae288
  25. 18 2月, 2008 1 次提交
  26. 17 1月, 2008 1 次提交
  27. 10 1月, 2008 1 次提交
  28. 05 1月, 2008 1 次提交
  29. 09 11月, 2007 1 次提交
  30. 19 9月, 2007 1 次提交
  31. 14 8月, 2007 1 次提交
  32. 11 8月, 2007 4 次提交
    • M
      builtin-bundle - use buffered reads for bundle header · 21a02980
      Mark Levedahl 提交于
      This eliminates all use of byte-at-a-time reading of data in this
      function: as Junio noted, a bundle file is seekable so we can
      reset the file position to the first part of the pack-file using lseek
      after reading the header.
      Signed-off-by: NMark Levedahl <mdl123@verizon.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      21a02980
    • M
      builtin-bundle.c - use stream buffered input for rev-list · 442b67a5
      Mark Levedahl 提交于
      git-bundle create on cygwin was nearly unusable due to 1 character
      at a time (unbuffered) reading from an exec'ed process. Fix by using
      fdopen to get a buffered stream.
      
      Results for "time git bundle create test.bdl v1.0.3..v1.5.2" are:
      
      before this patch:
               cygwin         linux
      real    1m38.828s      0m3.578s
      user    0m12.122s      0m2.896s
      sys     1m28.215s      0m0.692s
      
      after this patch:
      real    0m3.688s       0m2.835s
      user    0m3.075s       0m2.731s
      sys     0m1.075s       0m0.149s
      Signed-off-by: NMark Levedahl <mdl123@verizon.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      442b67a5
    • J
      allow git-bundle to create bottomless bundle · c06793a4
      Junio C Hamano 提交于
      Mark Levedahl <mlevedahl@gmail.com> writes:
      
      > Junio C Hamano wrote:
      >> While "git bundle" was a useful way to sneakernet incremental
      >> changes, we did not allow:
      >>
      > Thanks - I've been thinking for months I could fix this bug, never
      > figured it out and didn't want to nag Dscho one more time. I confirm
      > that this allows creation of bundles with arbitrary refs, not just
      > those under refs/heads. Yahoo!
      
      Actually, there is another bug nearby.
      
      If you do:
      
      	git bundle create v2.6-20-v2.6.22.bndl v2.6.20..v2.6.22
      
      the bundle records that it requires v2.6.20^0 commit (correct)
      and gives you tag v2.6.22 (incorrect); the bug is that the
      object it lists in fact is the commit v2.6.22^0, not the tag.
      
      This is because the revision range operation .. is always about
      set of commits, but the code near where my patch touches does
      not validate that the sha1 value obtained from dwim_ref()
      against the commit object name e->item->sha1 before placing the
      head information in the commit.
      
      The attached patch attempts to fix this problem.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c06793a4
    • J
      allow git-bundle to create bottomless bundle · 7fa8254f
      Junio C Hamano 提交于
      While "git bundle" was a useful way to sneakernet incremental
      changes, we did not allow:
      
      	$ git bundle create v2.6.20.bndl v2.6.20
      
      to create a bundle that contains the whole history to a
      well-known good revision.  Such a bundle can be mirrored
      everywhere, and people can prime their repository with it to
      reduce the load on the repository that serves near the tip of
      the development.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7fa8254f
  33. 15 7月, 2007 1 次提交
  34. 16 5月, 2007 1 次提交