1. 28 1月, 2007 15 次提交
    • N
      add logref support to git-symbolic-ref · 8b5157e4
      Nicolas Pitre 提交于
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8b5157e4
    • N
      move create_symref() past log_ref_write() · 41b625b0
      Nicolas Pitre 提交于
      This doesn't change the code at all.  It is done to make the next patch
      more obvious.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      41b625b0
    • N
      add reflog entries for HEAD when detached · e1dde3d0
      Nicolas Pitre 提交于
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e1dde3d0
    • N
      enable separate reflog for HEAD · bd104db1
      Nicolas Pitre 提交于
      If HEAD is tied to a branch then both logs/HEAD and logs/heads/<branch> are
      updated.  This is also true for any symbolic refs in general, but only HEAD
      will see its reflog created automatically.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      bd104db1
    • N
      lock_ref_sha1_basic(): remember the original name of a ref when resolving it · 1655707c
      Nicolas Pitre 提交于
      A ref might be pointing to another ref but only the name of the last ref
      is remembered.  Let's remember about the first name as well.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1655707c
    • N
      make reflog filename independent from struct ref_lock · 9a13f0b7
      Nicolas Pitre 提交于
      This allows for ref_log_write() to be used in a more flexible way,
      and is needed for future changes.
      
      This is only code reorg with no behavior change.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9a13f0b7
    • S
      Compute accurate distances in git-describe before output. · 1b600e65
      Shawn O. Pearce 提交于
      My prior change to git-describe attempts to print the distance
      between the input commit and the best matching tag, but this distance
      was usually only an estimate as we always aborted revision walking
      as soon as we overflowed the configured limit on the number of
      possible tags (as set by --candidates).
      
      Displaying an estimated distance is not very useful and can just be
      downright confusing.  Most users (heck, most Git developers) don't
      immediately understand why this distance differs from the output
      of common tools such as `git rev-list | wc -l`.  Even worse, the
      estimated distance could change in the future (including decreasing
      despite no rebase occuring) if we find more possible tags earlier
      on during traversal.  (This could happen if more tags are merged
      into the branch between queries.)  These factors basically make an
      estimated distance useless.
      
      Fortunately we are usually most of the way through an accurate
      distance computation by the time we abort (due to reaching the
      current --candidates limit).  This means we can simply finish
      counting out the revisions still in our commit queue to present
      the accurate distance at the end.  The number of commits remaining
      in the commit queue is probably less than the number of commits
      already traversed, so finishing out the count is not likely to take
      very long.  This final distance will then always match the output of
      `git rev-list | wc -l`.
      
      We can easily reduce the total number of commits that need to be
      walked at the end by stopping as soon as all of the commits in the
      commit queue are flagged as being merged into the already selected
      best possible tag.  If that's true then there are no remaining
      unseen commits which can contribute to our best possible tag's
      depth counter, so further traversal is useless.
      
      Basic testing on my Mac OS X system shows there is no noticable
      performance difference between this accurate distance counting
      version of git-describe and the prior version of git-describe,
      at least when run on git.git.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1b600e65
    • J
      Update describe documentation. · 1891261e
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1891261e
    • S
      Teach git-describe to display distances from tags. · 237fb6ca
      Shawn O. Pearce 提交于
      If you get two different describes at different
      times from a non-rewinding branch and they both come up with the same
      tag name, you can tell which is the 'newer' one by distance.  This is
      rather common in practice, so its incredibly useful.
      
      [jc: still needs documentation and fixups when traversal gives up
       early.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      237fb6ca
    • J
      git-blame --porcelain: quote filename in c-style when needed. · 46e5e69d
      Junio C Hamano 提交于
      Otherwise a pathname that has funny characters such as LF would
      screw up the parsing programs of the output.
      
      Strictly speaking, this is not backward compatible, but the
      current output for pathnames that have embedded LF and such
      cannot be sanely parsed anyway, and pathnames that only use
      characters from the portable pathname character set won't be
      affected.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      46e5e69d
    • L
      git-blame --incremental · 717d1462
      Linus Torvalds 提交于
      This adds --incremental option to help GUI porcelains to show
      the result from git-blame incrementally.  The output gives the
      origin information in the same format as the porcelain format.
      The first line has commit object name, the line number of the
      first line in the group in the original file, the line number of
      that file in the final image, and number of lines in the group.
      Then subsequent lines show the metainformation for the commit
      when the commit is shown for the first time, except the filename
      information is always shown (we cannot even make it conditional
      to -C option as blame always follows the renaming of the file
      wholesale).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      717d1462
    • J
      Don't force everybody to call setup_ident(). · 01754769
      Junio C Hamano 提交于
      Back when only handful commands that created commit and tag were
      the only users of committer identity information, it made sense
      to explicitly call setup_ident() to pre-fill the default value
      from the gecos information.  But it is much simpler for programs
      to make the call automatic when get_ident() is called these days,
      since many more programs want to use the information when updating
      the reflog.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      01754769
    • N
      git-log -g --pretty=oneline should display the reflog message · 903b45fe
      Nicolas Pitre 提交于
      In the context of reflog output the reflog message is more useful than
      the commit message's first line.  When relevant the reflog message
      will contain that line anyway.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      903b45fe
    • B
      Document --check option to git diff. · 16507fcf
      Bill Lear 提交于
      Signed-off-by: NBill Lear <rael@zopyra.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      16507fcf
    • A
      Allow the tag signing key to be specified in the config file · d67778ec
      Andy Parkins 提交于
      I did this:
      
        $ git tag -s test-sign
        gpg: skipped "Andy Parkins <andyparkins@gmail.com>": secret key not available
        gpg: signing failed: secret key not available
        failed to sign the tag with GPG.
      
      The problem is that I have used the comment field in my key's UID
      definition.
      
        $ gpg --list-keys andy
        pub   1024D/4F712F6D 2003-08-14
        uid                  Andy Parkins (Google) <andyparkins@gmail.com>
      
      So when git-tag looks for "Andy Parkins <andyparkins@gmail.com>";
      obviously it's not going to be found.
      
      There shouldn't be a requirement that I use the same form of my name in
      my git repository and my gpg key - I might want to be formal (Andrew) in
      my gpg key and informal (Andy) in the repository.  Further I might have
      multiple keys in my keyring, and might want to use one that doesn't
      match up with the address I use in commit messages.
      
      This patch adds a configuration entry "user.signingkey" which, if
      present, will be passed to the "-u" switch for gpg, allowing the tag
      signing key to be overridden.  If the entry is not present, the fallback
      is the original method, which means existing behaviour will continue
      untouched.
      Signed-off-by: NAndy Parkins <andyparkins@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d67778ec
  2. 27 1月, 2007 6 次提交
  3. 26 1月, 2007 11 次提交
    • J
      Make sure we do not write bogus reflog entries. · 8ac65937
      Junio C Hamano 提交于
      The file format dictates that entries are LF terminated so
      the message cannot have one in it.  Chomp the message to make
      sure it only has a single line if necessary, while removing the
      leading whitespace.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8ac65937
    • S
      Remove unnecessary found variable from describe. · 8a8169c0
      Shawn O. Pearce 提交于
      Junio added the found variable to enforce commit date order when two
      tags have the same distance from the requested commit.  Except it is
      unnecessary as match_cnt is already used to record how many possible
      tags have been identified thus far.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8a8169c0
    • J
      Use inttypes.h rather than stdint.h. · 007e2ba6
      Jason Riedy 提交于
      Older Solaris machines lack stdint.h but have inttypes.h.
      The standard has inttypes.h including stdint.h, so at worst
      this pollutes the namespace a bit.
      Signed-off-by: NJason Riedy <ejr@cs.berkeley.edu>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      007e2ba6
    • J
      Documentation: pack-refs --all vs default behaviour · af67e91c
      Junio C Hamano 提交于
      Document the recommended way to prime a repository with tons of
      references with 'pack-refs --all -prune'.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      af67e91c
    • J
      show-branch -g: default to HEAD · df373ea9
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      df373ea9
    • L
      Add dangling objects tips. · a9eefb3b
      Linus Torvalds 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a9eefb3b
    • J
    • J
      diffcore-pickaxe: fix infinite loop on zero-length needle · e1b16116
      Jeff King 提交于
      The "contains" algorithm runs into an infinite loop if the needle string
      has zero length. The loop could be modified to handle this, but it makes
      more sense to simply have an empty needle return no matches. Thus, a
      command like
        git log -S
      produces no output.
      
      We place the check at the top of the function so that we get the same
      results with or without --pickaxe-regex. Note that until now,
        git log -S --pickaxe-regex
      would match everything, not nothing.
      
      Arguably, an empty pickaxe string should simply produce an error
      message; however, this is still a useful assertion to add to the
      algorithm at this layer of the code.
      
      Noticed by Bill Lear.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e1b16116
    • J
      Allow non-developer to clone, checkout and fetch more easily. · cb280e10
      Junio C Hamano 提交于
      The code that uses committer_info() in reflog can barf and die
      whenever it is asked to update a ref.  And I do not think
      calling ignore_missing_committer_name() upfront like recent
      receive-pack did in the aplication is a reasonable workaround.
      
      What the patch does.
      
       - git_committer_info() takes one parameter.  It used to be "if
         this is true, then die() if the name is not available due to
         bad GECOS, otherwise issue a warning once but leave the name
         empty".  The reason was because we wanted to prevent bad
         commits from being made by git-commit-tree (and its
         callers).  The value 0 is only used by "git var -l".
      
         Now it takes -1, 0 or 1.  When set to -1, it does not
         complain but uses the pw->pw_name when name is not
         available.  Existing 0 and 1 values mean the same thing as
         they used to mean before.  0 means issue warnings and leave
         it empty, 1 means barf and die.
      
       - ignore_missing_committer_name() and its existing caller
         (receive-pack, to set the reflog) have been removed.
      
       - git-format-patch, to come up with the phoney message ID when
         asked to thread, now passes -1 to git_committer_info().  This
         codepath uses only the e-mail part, ignoring the name.  It
         used to barf and die.  The other call in the same program
         when asked to add signed-off-by line based on committer
         identity still passes 1 to make sure it barfs instead of
         adding a bogus s-o-b line.
      
       - log_ref_write in refs.c, to come up with the name to record
         who initiated the ref update in the reflog, passes -1.  It
         used to barf and die.
      
      The last change means that git-update-ref, git-branch, and
      commit walker backends can now be used in a repository with
      reflog by somebody who does not have the user identity required
      to make a commit.  They all used to barf and die.
      
      I've run tests and all of them seem to pass, and also tried "git
      clone" as a user whose GECOS is empty -- git clone works again
      now (it was broken when reflog was enabled by default).
      
      But this definitely needs extra sets of eyeballs.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cb280e10
    • S
      contrib/emacs/vc-git.el: support vc-version-other-window · fd73423f
      Sam Vilain 提交于
      Currently, the vc-git-checkout function uses `git checkout' to fetch a
      file from the git repository to the working copy.  However, it is
      completely ignoring the input argument that specifies the destination
      file.  `git-checkout' does not support specifying this, so we have to
      use `git-cat-file', capture the output in a buffer and then save it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      fd73423f
    • L
      Fix seriously broken "git pack-refs" · 1b555932
      Linus Torvalds 提交于
      Do *NOT* try this on a repository you care about:
      
      	git pack-refs --all --prune
      	git pack-refs
      
      because while the first "pack-refs" does the right thing, the second
      pack-refs will totally screw you over.
      
      This is because the second one tries to pack only tags; we should
      also pack what are already packed -- otherwise we would lose them.
      
      [jc: with an additional test]
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1b555932
  4. 25 1月, 2007 8 次提交