1. 06 2月, 2007 13 次提交
  2. 05 2月, 2007 5 次提交
  3. 04 2月, 2007 22 次提交
    • J
      git-clone --reference: saner handling of borrowed symrefs. · 1f7d1a53
      Junio C Hamano 提交于
      When using --reference to borrow objects from a neighbouring
      repository while cloning, we copy the entire set of refs under
      temporary "refs/reference-tmp/refs" space and set up the object
      alternates.  However, a textual symref copied this way would not
      point at the right place, and causes later steps to emit error
      messages (which is harmless but still alarming).  This is most
      visible when using a clone created with the separate-remote
      layout as a reference, because such a repository would have
      refs/remotes/origin/HEAD with 'ref: refs/remotes/origin/master'
      as its contents.
      
      Although we do not create symbolic-link based refs anymore, they
      have the same problem because they are always supposed to be
      relative to refs/ hierarchy (we dereference by hand, so it only
      is good for HEAD and nothing else).
      
      In either case, the solution is simply to remove them after
      copying under refs/reference-tmp; if a symref points at a true
      ref, that true ref itself is enough to ensure that objects
      reachable from it do not needlessly get fetched.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1f7d1a53
    • S
      bash: Support internal revlist options better. · ec804891
      Shawn O. Pearce 提交于
      format-patch/log/whatchanged all take --not and --all as options
      to the internal revlist process.  So these should be supported
      as possible completions.
      
      gitk takes anything rev-list/log/whatchanged takes, so we should
      use complete_revlist to handle its options.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ec804891
    • S
      bash: Support unique completion when possible. · b3391775
      Shawn O. Pearce 提交于
      Because our use of -o nospace prevents bash from adding a trailing space
      when a completion is unique and has been fully completed, we need to
      perform this addition on our own.  This (large) change converts all
      existing uses of compgen to our wrapper __gitcomp which attempts to
      handle this by tacking a trailing space onto the end of each offered
      option.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b3391775
    • S
      bash: Support unique completion on git-config. · 78d4d6a2
      Shawn O. Pearce 提交于
      In many cases we know a completion will be unique, but we've disabled
      bash's automatic space addition (-o nospace) so we need to do it
      ourselves when necessary.
      
      This change adds additional support for new configuration options
      added in 1.5.0, as well as some extended completion support for
      the color.* family of options.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      78d4d6a2
    • S
      bash: Classify more commends out of completion. · a925c6f1
      Shawn O. Pearce 提交于
      Most of these commands are not ones you want to invoke from the
      command line on a frequent basis, or have been renamed in 1.5.0 to
      more friendly versions, but the old names are being left behind to
      support existing scripts in the wild.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a925c6f1
    • S
      bash: Add space after unique command name is completed. · 72e5e989
      Shawn O. Pearce 提交于
      Because we use the nospace option for our completion function for
      the main 'git' wrapper bash won't automatically add a space after a
      unique completion has been made by the user.  This has been pointed
      out in the past by Linus Torvalds as an undesired behavior.  I agree.
      
      We have to use the nospace option to ensure path completion for
      a command such as `git show` works properly, but that breaks the
      common case of getting the space for a unique completion.  So now we
      set IFS=$'\n' (linefeed) and add a trailing space to every possible
      completion option.  This causes bash to insert the space when the
      completion is unique.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      72e5e989
    • S
      bash: Complete long options to git-add. · 8435b548
      Shawn O. Pearce 提交于
      The new --interactive mode of git-add can be very useful, so users
      will probably want to have completion for it.
      
      Likewise the new git-add--interactive executable is actually a
      plumbing command.  Its invoked by `git add --interactive` and is
      not intended to be invoked directly by the user.  Therefore we
      should hide it from the list of available Git commands.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8435b548
    • S
      bash: Classify cat-file and reflog as plumbing. · 2e3a430a
      Shawn O. Pearce 提交于
      Now that git-show is capable of displaying any file content from any
      revision and is the approved Porcelain-ish level method of doing so,
      cat-file should no longer be classified as a user-level utility by
      the bash completion package.
      
      I'm also classifying the new git-reflog command as plumbing for the
      time being as there are no subcommands which are really useful to
      the end-user.  git-gc already invokes `git reflog expire --all`,
      which makes it rather unnecessary for the user to invoke it directly.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2e3a430a
    • S
      bash: Remove short option completions for branch/checkout/diff. · 9f4cc6f7
      Shawn O. Pearce 提交于
      The short options (-l, -f, -d) for git-branch are rather silly to
      include in the completion generation as these options must be fully
      typed out by the user and most users already know what the options
      are anyway, so including them in the suggested completions does
      not offer huge value.  (The same goes for git-checkout and git-diff.)
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9f4cc6f7
    • J
      show-branch -g: default to the current branch. · 632ac9fd
      Junio C Hamano 提交于
      Now we have a separate reflog on HEAD, show-branch -g without an explicit
      parameter defaults to the current branch, or HEAD when it is detached
      from branches.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      632ac9fd
    • N
      Let git-checkout always drop any detached head · dc9195ac
      Nicolas Pitre 提交于
      We used to refuse leaving a detached HEAD when it wasn't matching an
      existing ref so not to lose any commit that might have been performed
      while not on any branch (unless -f was provided).
      
      But this protection was completely bogus since it was still possible
      to move to HEAD^ while still remaining detached but losing the last
      commit anyway if there was one.
      
      Now that we have a proper reflog for HEAD it is best to simply remove
      that bogus (and admitedly annoying) protection and simply display the
      last HEAD position instead.  If one wants to recover a lost detached
      state then it can be retrieved from the HEAD reflog.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dc9195ac
    • N
      f2eba66d
    • J
      Merge branch 'master' into np/dreflog · d77ee726
      Junio C Hamano 提交于
      This is to resolve conflicts early in preparation for possible
      inclusion of "reflog on detached HEAD" series by Nico, as having
      it in 1.5.0 would really help us remove confusion between
      detached and attached states.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d77ee726
    • S
      Default GIT_MERGE_VERBOSITY to 5 during tests. · 8d0fc48f
      Shawn O. Pearce 提交于
      Its really nice to be able to run a test with -v and automatically
      see the "debugging" dump from merge-recursive, especially if we
      are actually trying to debug merge-recursive.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8d0fc48f
    • S
      Keep untracked files not involved in a merge. · 183d7972
      Shawn O. Pearce 提交于
      My earlier fix (8371234e) to delete renamed tracked files from the
      working directory also caused merge-recursive to delete untracked
      files that were in the working directory.
      
      The problem here is merge-recursive is deleting the working directory
      file without regard for which branch it was associated with.  What we
      really want to do during a merge is to only delete files that were
      renamed by the branch we are merging into the current branch,
      and that are still tracked by the current branch.  These files
      definitely don't belong in the working directory anymore.
      
      Anything else is either a merge conflict (already handled in other
      parts of the code) or a file that is untracked by the current branch
      and thus is not even participating in the merge.  Its this latter
      class that must be left alone.
      
      For this fix to work we are now assuming that the first non-base
      argument passed to git-merge-recursive always corresponds to the
      working directory.  This is already true for all in-tree callers
      of merge-recursive.  This assumption is also supported by the
      long time usage message of "<base> ... -- <head> <remote>", where
      "<head>" is implied to be HEAD, which is generally assumed to be
      the current tree-ish.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      183d7972
    • P
      Assorted typo fixes · 3dff5379
      Pavel Roskin 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3dff5379
    • S
      Cleanup subcommand documentation for git-remote. · 0f390875
      Shawn O. Pearce 提交于
      Jakub Narebski pointed out the positional notation in git-remote's
      documentation was very confusing, especially now that we have 3
      supported subcommands.  Instead of referring to subcommands by
      position, refer to them by name.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0f390875
    • P
      git-config --rename-section could rename wrong section · 9673a0b1
      Pavel Roskin 提交于
      The "git-config --rename-section" implementation would match sections
      that are substrings of the section name to be renamed.
      Signed-off-by: NPavel Roskin <proski@gnu.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9673a0b1
    • J
      combine-diff: special case --unified=0 · 3b0f5e88
      Junio C Hamano 提交于
      Even when --unified=0 is given, the main loop to show the
      combined textual diff needs to handle a line that is unchanged
      but has lines that were deleted relative to a parent before it
      (because that is where the lost lines hang).  However, such a
      line should not be emitted in the final output.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3b0f5e88
    • J
      Why is it bad to rewind a branch that has already been pushed out? · a9d1836b
      Junio C Hamano 提交于
      I was reading the tutorial and noticed that we say this:
      
          Also, don't use "git reset" on a publicly-visible branch that
          other developers pull from, as git will be confused by history
          that disappears in this way.
      
      I do not think this is a good explanation.  For example, if we
      do this:
      
      (1) I build a series and push it out.
      
      	---o---o---o---j
      
      (2) Alice clones from me, and builds two commits on top of it.
      
      	---o---o---o---j---a---a
      
      (3) I rewind one and build a few, and push them out.
      
      	---o---o---o...j
                          \
                           h---h---h---h
      
      (4) Alice pulls from me again:
      
      	---o---o---o---j---a---a---*
                          \             /
                           h---h---h---h
      
      Contrary to the description, git will happily have Alice merge
      between the two branches, and never gets confused.
      
      Maybe I did not want to have 'j' because it was an incomplete
      solution to some problem, and Alice may have fixed it up with
      her changes, while I abandoned that approach I started with 'j',
      and worked on something completely unrelated in the four 'h'
      commits.  In such a case, the merge Alice would make would be
      very sensible, and after she makes the merge if I pull from her,
      the world will be perfect.  I started something with 'j' and
      dropped the ball, Alice picked it up and perfected it while I
      went on to work on something else with 'h'.  This would be a
      perfect example of distributed parallel collaboration.  There is
      nothing confused about it.
      
      The case the rewinding becomes problematic is if the work done
      in 'h' tries to solve the same problem as 'j' tried to solve in
      a different way.  Then the merge forced on Alice would make her
      pick between my previous attempt with her fixups (j+a) and my
      second attempt (h).  If 'a' commits were to fix up what 'j'
      started, presumably Alice already studied and knows enough about
      the problem so she should be able to make an informed decision
      to pick between what 'j+a' and 'h' do.
      
      A lot worse case is if Alice's work is not at all related to
      what 'j' wanted to do (she did not mean to pick up from where I
      left off -- she just wanted to work on something different).
      Then she would not be familiar enough with what 'j' and 'h'
      tried to achieve, and I'd be forcing her to pick between the
      two.  Of course if she can make the right decision, then again
      that is a perfect example of distributed collaboration, but that
      does not change the fact that I'd be forcing her to clean up my
      mess.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a9d1836b
    • J
      honor GIT_REFLOG_ACTION in git-commit · 23913dc7
      Junio C Hamano 提交于
      This allows git-cherry-pick and git-revert to properly identify
      themselves in the resulting reflog entries.  Earlier they were
      recorded as what git-commit has done.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      23913dc7
    • J
      fix reflog entries for "git-branch" · 5f856dd4
      Junio C Hamano 提交于
      Even when -l is not given from the command line, the repository
      may have the configuration variable core.logallrefupdates set,
      or an old-timer might have done ": >.git/logs/refs/heads/new"
      before running "git branch new".  In these cases, the code gave
      an uninitialized msg[] from the stack to be written out as the
      reflog message.
      
      This also passes a different message when '-f' option is used.
      Saying "git branch -f branch some-commit" is a moral equilvalent
      of doing "git-reset some-commit" while on the branch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5f856dd4