1. 09 12月, 2011 3 次提交
    • J
      t7501 (commit): modernize style · 1af524eb
      Jonathan Nieder 提交于
      Put the opening quote starting each test on the same line as the
      test_expect_* invocation.  While at it:
      
      - guard commands that prepare test input for individual tests in
        the same test_expect_success, so their scope is clearer and
        errors at that stage can be caught;
      - use the compare_diff_patch helper function when comparing patches;
      - use single-quotes in preference to double-quotes and <<\EOF in
        preference to <<EOF, to save readers the trouble of looking for
        variable interpolations;
      - lift the setting of the $author variable used throughout the
        test script to the top of the test script;
      - include "setup" in the titles of test assertions that prepare for
        later ones to make it more obvious which tests can be skipped;
      - use test_must_fail instead of "if ...; then:; else false; fi",
        for clarity and to catch segfaults when they happen;
      - break up some pipelines into separate commands that read and write
        to ordinary files, and test the exit status at each stage;
      - chain commands with &&.  Breaks in a test assertion's && chain can
        potentially hide failures from earlier commands in the chain;
      - combine two initial tests that do not make as much sense alone.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1af524eb
    • J
      test: remove a porcelain test that hard-codes commit names · 67a612c4
      Jonathan Nieder 提交于
      The rev-list output in this test depends on the details of test_tick's
      dummy dates and the choice of hash function.  Worse, it depends on the
      order and nature of commits made in the earlier tests, so adding new
      tests or rearranging existing ones breaks it.
      
      It would be nice to check that "git commit" and commit-tree name
      objects consistently and that commit objects' text is as documented,
      but this particular test checks everything at once and hence is not a
      robust test for that.  Remove it.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      67a612c4
    • J
      test: add missing "&&" after echo command · 7b438f62
      Jonathan Nieder 提交于
      This test wants to modify a file and commit the change, but because of
      a missing separator between commands it is parsed as a single "echo"
      command.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7b438f62
  2. 06 12月, 2011 6 次提交
  3. 03 12月, 2011 1 次提交
  4. 29 11月, 2011 1 次提交
  5. 24 11月, 2011 5 次提交
  6. 23 11月, 2011 8 次提交
    • J
      017d1e13
    • J
      Merge branch 'jn/revert-quit' · 9fd389b6
      Junio C Hamano 提交于
      * jn/revert-quit:
        revert: remove --reset compatibility option
        revert: introduce --abort to cancel a failed cherry-pick
        revert: write REVERT_HEAD pseudoref during conflicted revert
        revert: improve error message for cherry-pick during cherry-pick
        revert: rearrange pick_revisions() for clarity
        revert: rename --reset option to --quit
      9fd389b6
    • J
      revert: remove --reset compatibility option · c427b211
      Jonathan Nieder 提交于
      Remove the "git cherry-pick --reset" option, which has a different
      preferred spelling nowadays ("--quit").  Luckily the old --reset name
      was not around long enough for anyone to get used to it.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c427b211
    • J
      revert: introduce --abort to cancel a failed cherry-pick · 539047c1
      Jonathan Nieder 提交于
      After running some ill-advised command like "git cherry-pick
      HEAD..linux-next", the bewildered novice may want to return to more
      familiar territory.  Introduce a "git cherry-pick --abort" command
      that rolls back the entire cherry-pick sequence and places the
      repository back on solid ground.
      
      Just like "git merge --abort", this internally uses "git reset
      --merge", so local changes not involved in the conflict resolution are
      preserved.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      539047c1
    • J
      revert: write REVERT_HEAD pseudoref during conflicted revert · 82433cdf
      Jonathan Nieder 提交于
      When conflicts are encountered while reverting a commit, it can be
      handy to have the name of that commit easily available.  For example,
      to produce a copy of the patch to refer to while resolving conflicts:
      
      	$ git revert 2eceb2a8
      	error: could not revert 2eceb2a8... awesome, buggy feature
      	$ git show -R REVERT_HEAD >the-patch
      	$ edit $(git diff --name-only)
      
      Set a REVERT_HEAD pseudoref when "git revert" does not make a commit,
      for cases like this.  This also makes it possible for scripts to
      distinguish between a revert that encountered conflicts and other
      sources of an unmerged index.
      
      After successfully committing, resetting with "git reset", or moving
      to another commit with "git checkout" or "git reset", the pseudoref is
      no longer useful, so remove it.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      82433cdf
    • J
      revert: improve error message for cherry-pick during cherry-pick · b8c74690
      Jonathan Nieder 提交于
      In the spirit of v1.6.3.3~3^2 (refuse to merge during a merge,
      2009-07-01), "git cherry-pick" refuses to start a new cherry-pick when
      in the middle of an existing conflicted cherry-pick in the following
      sequence:
      
       1. git cherry-pick HEAD..origin
       2. resolve conflicts
       3. git cherry-pick HEAD..origin (instead of "git cherry-pick
          --continue", by mistake)
      
      Good.  However, the error message on attempting step 3 is more
      convoluted than necessary:
      
        $ git cherry-pick HEAD..origin
        error: .git/sequencer already exists.
        error: A cherry-pick or revert is in progress.
        hint: Use --continue to continue the operation
        hint: or --quit to forget about it
        fatal: cherry-pick failed
      
      Clarify by removing the redundant first "error:" message, simplifying
      the advice, and using lower-case and no full stops to be consistent
      with other commands that prefix their messages with "error:", so it
      becomes
      
        error: a cherry-pick or revert is already in progress
        hint: try "git cherry-pick (--continue | --quit)"
        fatal: cherry-pick failed
      
      The "fatal: cherry-pick failed" line seems unnecessary, too, but
      that can be fixed some other day.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b8c74690
    • J
      revert: rearrange pick_revisions() for clarity · dffc8600
      Jonathan Nieder 提交于
      Deal completely with "cherry-pick --quit" and --continue at the
      beginning of pick_revisions(), leaving the rest of the function for
      the more interesting "git cherry-pick <commits>" case.
      
      No functional change intended.  The impact is just to unindent the
      code a little.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dffc8600
    • J
      revert: rename --reset option to --quit · f80a8726
      Jonathan Nieder 提交于
      The option to "git cherry-pick" and "git revert" to discard the
      sequencer state introduced by v1.7.8-rc0~141^2~6 (revert: Introduce
      --reset to remove sequencer state, 2011-08-04) has a confusing name.
      Change it now, while we still have the time.
      
      The new name for "cherry-pick, please get out of my way, since I've
      long forgotten about the sequence of commits I was cherry-picking when
      you wrote that old .git/sequencer directory" is --quit.  Mnemonic:
      this is analagous to quiting a program the user is no longer using ---
      we just want to get out of the multiple-command cherry-pick procedure
      and not to reset HEAD or rewind any other old state.
      
      The "--reset" option is kept as a synonym to minimize the impact.  We
      might consider dropping it for simplicity in a separate patch, though.
      
      Adjust documentation and tests to use the newly preferred name (--quit)
      instead of --reset.  While at it, let's clarify the short descriptions
      of these operations in "-h" output.
      
      Before:
      
      	--reset		forget the current operation
      	--continue	continue the current operation
      
      After:
      
      	--quit		end revert or cherry-pick sequence
      	--continue	resume revert or cherry-pick sequence
      Noticed-by: NPhil Hord <phil.hord@gmail.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f80a8726
  7. 22 11月, 2011 4 次提交
  8. 21 11月, 2011 2 次提交
    • R
      config.c: Fix a static buffer overwrite bug by avoiding mkpath() · 05bab3ea
      Ramsay Jones 提交于
      On cygwin, test number 21 of t3200-branch.sh (git branch -m q q2
      without config should succeed) fails. The failure involves the
      functions from path.c which parcel out internal static buffers
      from the git_path() and mkpath() functions.
      
      In particular, the rename_ref() function calls safe_create_leading\
      _directories() with a filename returned by git_path("logs/%s", ref).
      safe_create_leading_directories(), in turn, calls stat() on each
      element of the path it is given. On cygwin, this leads to a call
      to git_config() for each component of the path, since this test
      explicitly removes the config file. git_config() calls mkpath(), so
      on the fourth component of the path, the original buffer passed
      into the function is overwritten with the config filename.
      
      Note that this bug is specific to cygwin and it's schizophrenic
      stat() functions (see commits adbc0b6b, 7faee6b8 and 79748439). The
      lack of a config file and a path with at least four elements is
      also important to trigger the bug.
      
      In order to fix the problem, we replace the call to mkpath() with
      a call to mksnpath() and provide our own buffer.
      Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      05bab3ea
    • R
      t5501-*.sh: Fix url passed to clone in setup test · 3a81f33c
      Ramsay Jones 提交于
      In particular, the url passed to git-clone has an extra '/' given
      after the 'file://' schema prefix, thus:
      
          git clone --reference=original "file:///$(pwd)/original one
      
      Once the prefix is removed, the remainder of the url looks something
      like "//home/ramsay/git/t/...", which is then interpreted as an
      network path. This then results in a "Permission denied" error, like
      so:
      
          ramsay $ ls //home
          ls: cannot access //home: No such host or network path
          ramsay $ ls //home/ramsay
          ls: cannot access //home/ramsay: Permission denied
          ramsay $
      
      In order to fix the problem, we simply remove the extraneous '/'
      character from the url.
      Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3a81f33c
  9. 19 11月, 2011 9 次提交
  10. 18 11月, 2011 1 次提交