1. 06 11月, 2007 1 次提交
  2. 30 9月, 2007 1 次提交
  3. 27 9月, 2007 2 次提交
  4. 17 9月, 2007 1 次提交
  5. 11 9月, 2007 1 次提交
  6. 10 9月, 2007 1 次提交
    • C
      git-tag -s must fail if gpg cannot sign the tag. · aba91192
      Carlos Rica 提交于
      Most of this patch code and message was written by Shawn O. Pearce.
      I made some tests to know what the problem was, and then I changed
      the code related with the SIGPIPE signal.
      
      If the user has misconfigured `user.signingkey` in their .git/config
      or just doesn't have any secret keys on their keyring and they ask
      for a signed tag with `git tag -s` we better make sure the resulting
      tag was actually signed by gpg.
      
      Prior versions of builtin git-tag allowed this failure to slip
      by without error as they were not checking the return value of
      the finish_command() so they did not notice when gpg exited with
      an error exit status.  They also did not fail if gpg produced an
      empty output or if read_in_full received an error from the read
      system call while trying to read the pipe back from gpg.
      
      Finally, we did not actually honor any return value from the do_sign
      function as it returns ssize_t but was being stored into an unsigned
      long.  This caused the compiler to optimize out the die condition,
      allowing git-tag to continue along and create the tag object.
      
      However, when gpg gets a wrong username, it exits before any read was done
      and then the writing process receives SIGPIPE and program is terminated.
      By ignoring this signal, anyway, the function write_or_die gets EPIPE from
      write_in_full and exits returning 0 to the system without a message.
      Here we better call to write_in_full directly so we can fail
      printing a message and return safely to the caller.
      
      With these issues fixed `git-tag -s` will now fail to create the
      tag and will report a non-zero exit status to its caller, thereby
      allowing automated helper scripts to detect (and recover from)
      failure if gpg is not working properly.
      Proposed-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NCarlos Rica <jasampler@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      aba91192
  7. 01 9月, 2007 1 次提交
    • C
      git-tag: Fix -l option to use better shell style globs. · 18e32b5b
      Carlos Rica 提交于
      This patch removes certain behaviour of "git tag -l foo", currently
      listing every tag name having "foo" as a substring.  The same
      thing now could be achieved doing "git tag -l '*foo*'".
      
      This feature was added recently when git-tag.sh got the -n option
      for showing tag annotations, because that commit also replaced the
      old "grep pattern" behaviour with a more preferable "shell pattern"
      behaviour (although slightly modified as you can see).
      Thus, the following builtin-tag.c implemented it in order to
      ensure that tests were passing unchanged with both programs.
      
      Since common "shell patterns" match names with a given substring
      _only_ when * is inserted before and after (as in "*substring*"), and
      the "plain" behaviour cannot be achieved easily with the current
      implementation, this is mostly the right thing to do, in order to
      make it more flexible and consistent.
      
      Tests for "git tag" were also changed to reflect this.
      Signed-off-by: NCarlos Rica <jasampler@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      18e32b5b
  8. 22 7月, 2007 2 次提交
  9. 20 7月, 2007 1 次提交
    • C
      Make git tag a builtin. · 62e09ce9
      Carlos Rica 提交于
      This replaces the script "git-tag.sh" with "builtin-tag.c".
      
      The existing test suite for "git tag" guarantees the compatibility
      with the features provided by the script version.
      
      There are some minor changes in the behaviour of "git tag" here:
      "git tag -v" now can get more than one tag to verify, like "git tag -d" does,
      "git tag" with no arguments prints all tags, more like "git branch" does,
      and "git tag -n" also prints all tags with annotations (without needing -l).
      Tests and documentation were also updated to reflect these changes.
      
      The program is currently calling the script "git verify-tag" for verify.
      This can be changed porting it to C and calling its functions directly
      from builtin-tag.c.
      Signed-off-by: NCarlos Rica <jasampler@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      62e09ce9