1. 24 11月, 2011 5 次提交
  2. 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
  3. 22 11月, 2011 4 次提交
  4. 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
  5. 19 11月, 2011 9 次提交
  6. 18 11月, 2011 3 次提交
  7. 17 11月, 2011 2 次提交
    • J
      refs: loosen over-strict "format" check · 09116a1c
      Junio C Hamano 提交于
      The add_extra_ref() interface is used to add an extra-ref that is _not_
      our ref for the purpose of helping auto-following of tags and reducing
      object transfer from remote repository, and they are typically formatted
      as a tagname followed by ^{} to make sure no valid refs match that
      pattern. In other words, these entries are deliberately formatted not to
      pass check-refname-format test.
      
      A recent series however added a test unconditionally to the add_ref()
      function that is called from add_extra_ref(). The check may be sensible
      for other two callsites of the add_ref() interface, but definitely is
      a wrong thing to do in add_extra_ref(). Disable it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Acked-by: NMichael Haggerty <mhagger@alum.mit.edu>
      09116a1c
    • M
      mailmap: xcalloc mailmap_info · 74b531f6
      Marc-André Lureau 提交于
      This is to avoid reaching free of uninitialized members.
      
      With an invalid .mailmap (and perhaps in other cases), it can reach
      free(mi->name) with garbage for example.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      74b531f6
  8. 16 11月, 2011 7 次提交