1. 25 5月, 2018 1 次提交
  2. 17 11月, 2016 1 次提交
    • J
      rev-parse: fix parent shorthands with --symbolic · a2e7b04c
      Jeff King 提交于
      The try_parent_shorthands() function shows each parent via
      show_rev(). We pass the correct parent sha1, but our "name"
      parameter still points at the original refname. So asking
      for a regular rev-parse works fine (it prints the sha1s),
      but asking for the symbolic name gives nonsense like:
      
          $ git rev-parse --symbolic HEAD^-1
          HEAD
          ^HEAD
      
      which is always an empty set of commits. Asking for "^!" is
      likewise broken, with the added bonus that its prints ^HEAD
      for _each_ parent. And "^@" just prints HEAD repeatedly.
      
      Arguably it would be correct to just pass NULL as the name
      here, and always get the parent expressed as a sha1. The
      "--symbolic" documentaton claims only "as close to the
      original input as possible", and we certainly fallback to
      sha1s where necessary. But it's pretty easy to generate a
      symbolic name on the fly from the original.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a2e7b04c
  3. 28 9月, 2016 1 次提交
  4. 24 3月, 2016 1 次提交
    • J
      merge: refuse to create too cool a merge by default · e379fdf3
      Junio C Hamano 提交于
      While it makes sense to allow merging unrelated histories of two
      projects that started independently into one, in the way "gitk" was
      merged to "git" itself aka "the coolest merge ever", such a merge is
      still an unusual event.	 Worse, if somebody creates an independent
      history by starting from a tarball of an established project and
      sends a pull request to the original project, "git merge" however
      happily creates such a merge without any sign of something unusual
      is happening.
      
      Teach "git merge" to refuse to create such a merge by default,
      unless the user passes a new "--allow-unrelated-histories" option to
      tell it that the user is aware that two unrelated projects are
      merged.
      
      Because such a "two project merge" is a rare event, a configuration
      option to always allow such a merge is not added.
      
      We could add the same option to "git pull" and have it passed
      through to underlying "git merge".  I do not have a fundamental
      opposition against such a feature, but this commit does not do so
      and instead leaves it as low-hanging fruit for others, because such
      a "two project merge" would be done after fetching the other project
      into some location in the working tree of an existing project and
      making sure how well they fit together, it is sufficient to allow a
      local merge without such an option pass-through from "git pull" to
      "git merge".  Many tests that are updated by this patch does the
      pass-through manually by turning:
      
      	git pull something
      
      into its equivalent:
      
      	git fetch something &&
      	git merge --allow-unrelated-histories FETCH_HEAD
      
      If somebody is inclined to add such an option, updated tests in this
      change need to be adjusted back to:
      
      	git pull --allow-unrelated-histories something
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e379fdf3
  5. 28 12月, 2013 1 次提交
    • J
      Remove the line length limit for graft files · e228c173
      Johannes Schindelin 提交于
      Support for grafts predates Git's strbuf, and hence it is understandable
      that there was a hard-coded line length limit of 1023 characters (which
      was chosen a bit awkwardly, given that it is *exactly* one byte short of
      aligning with the 41 bytes occupied by a commit name and the following
      space or new-line character).
      
      While regular commit histories hardly win comprehensibility in general
      if they merge more than twenty-two branches in one go, it is not Git's
      business to limit grafts in such a way.
      
      In this particular developer's case, the use case that requires
      substantially longer graft lines to be supported is the visualization of
      the commits' order implied by their changes: commits are considered to
      have an implicit relationship iff exchanging them in an interactive
      rebase would result in merge conflicts.
      
      Thusly implied branches tend to be very shallow in general, and the
      resulting thicket of implied branches is usually very wide; It is
      actually quite common that *most* of the commits in a topic branch have
      not even one implied parent, so that a final merge commit has about as
      many implied parents as there are commits in said branch.
      
      [jc: squashed in tests by Jonathan]
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e228c173
  6. 04 9月, 2013 4 次提交
  7. 08 5月, 2010 1 次提交
  8. 17 8月, 2008 1 次提交
    • J
      tests: use $TEST_DIRECTORY to refer to the t/ directory · bfdbee98
      Junio C Hamano 提交于
      Many test scripts assumed that they will start in a 'trash' subdirectory
      that is a single level down from the t/ directory, and referred to their
      test vector files by asking for files like "../t9999/expect".  This will
      break if we move the 'trash' subdirectory elsewhere.
      
      To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can
      refer to t/ directory reliably.  This finally makes all the tests use
      it to refer to the outside environment.
      
      With this patch, and a one-liner not included here (because it would
      contradict with what Dscho really wants to do):
      
      | diff --git a/t/test-lib.sh b/t/test-lib.sh
      | index 70ea7e0..60e69e4 100644
      | --- a/t/test-lib.sh
      | +++ b/t/test-lib.sh
      | @@ -485,7 +485,7 @@ fi
      |  . ../GIT-BUILD-OPTIONS
      |
      |  # Test repository
      | -test="trash directory"
      | +test="trash directory/another level/yet another"
      |  rm -fr "$test" || {
      |         trap - exit
      |         echo >&5 "FATAL: Cannot prepare test area"
      
      all the tests still pass, but we would want extra sets of eyeballs on this
      type of change to really make sure.
      
      [jc: with help from Stephan Beyer on http-push tests I do not run myself;
       credits for locating silly quoting errors go to Olivier Marin.]
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bfdbee98
  9. 28 7月, 2008 1 次提交
  10. 14 7月, 2008 1 次提交
  11. 02 2月, 2008 1 次提交
    • J
      Sane use of test_expect_failure · 41ac414e
      Junio C Hamano 提交于
      Originally, test_expect_failure was designed to be the opposite
      of test_expect_success, but this was a bad decision.  Most tests
      run a series of commands that leads to the single command that
      needs to be tested, like this:
      
          test_expect_{success,failure} 'test title' '
      	setup1 &&
              setup2 &&
              setup3 &&
              what is to be tested
          '
      
      And expecting a failure exit from the whole sequence misses the
      point of writing tests.  Your setup$N that are supposed to
      succeed may have failed without even reaching what you are
      trying to test.  The only valid use of test_expect_failure is to
      check a trivial single command that is expected to fail, which
      is a minority in tests of Porcelain-ish commands.
      
      This large-ish patch rewrites all uses of test_expect_failure to
      use test_expect_success and rewrites the condition of what is
      tested, like this:
      
          test_expect_success 'test title' '
      	setup1 &&
              setup2 &&
              setup3 &&
              ! this command should fail
          '
      
      test_expect_failure is redefined to serve as a reminder that
      that test *should* succeed but due to a known breakage in git it
      currently does not pass.  So if git-foo command should create a
      file 'bar' but you discovered a bug that it doesn't, you can
      write a test like this:
      
          test_expect_failure 'git-foo should create bar' '
              rm -f bar &&
              git foo &&
              test -f bar
          '
      
      This construct acts similar to test_expect_success, but instead
      of reporting "ok/FAIL" like test_expect_success does, the
      outcome is reported as "FIXED/still broken".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      41ac414e
  12. 03 7月, 2007 1 次提交
  13. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  14. 30 5月, 2007 1 次提交
  15. 26 1月, 2006 1 次提交
  16. 20 12月, 2005 1 次提交
  17. 08 9月, 2005 1 次提交
    • J
      Big tool rename. · 215a7ad1
      Junio C Hamano 提交于
      As promised, this is the "big tool rename" patch.  The primary differences
      since 0.99.6 are:
      
        (1) git-*-script are no more.  The commands installed do not
            have any such suffix so users do not have to remember if
            something is implemented as a shell script or not.
      
        (2) Many command names with 'cache' in them are renamed with
            'index' if that is what they mean.
      
      There are backward compatibility symblic links so that you and
      Porcelains can keep using the old names, but the backward
      compatibility support  is expected to be removed in the near
      future.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      215a7ad1
  18. 11 8月, 2005 1 次提交