This project is mirrored from https://github.com/git/git. Pull mirroring updated .
  1. 19 Mar, 2014 1 commit
    • David Tran's avatar
      tests: use "env" to run commands with temporary env-var settings · 512477b1
      David Tran authored
      Ordinarily, we would say "VAR=VAL command" to execute a tested
      command with environment variable(s) set only for that command.
      This however does not work if 'command' is a shell function (most
      notably 'test_must_fail'); the result of the assignment is retained
      and affects later commands.
      
      To avoid this, we used to assign and export environment variables
      and run such a test in a subshell, like so:
      
              (
                      VAR=VAL && export VAR &&
                      test_must_fail git command to be tested
              )
      
      But with "env" utility, we should be able to say:
      
              test_must_fail env VAR=VAL git command to be tested
      
      which is much shorter and easier to read.
      Signed-off-by: default avatarDavid Tran <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      512477b1
  2. 20 Feb, 2014 1 commit
    • Johan Herland's avatar
      notes: disallow reusing non-blob as a note object · ce8daa1e
      Johan Herland authored
      Currently "git notes add -C $object" will read the raw bytes from $object,
      and then copy those bytes into the note object, which is hardcoded to be
      of type blob. This means that if the given $object is a non-blob (e.g.
      tree or commit), the raw bytes from that object is copied into a blob
      object. This is probably not useful, and certainly not what any sane
      user would expect. So disallow it, by erroring out if the $object passed
      to the -C option is not a blob.
      
      The fix also applies to the -c option (in which the user is prompted to
      edit/verify the note contents in a text editor), and also when -c/-C is
      passed to "git notes append" (which appends the $object contents to an
      existing note object). In both cases, passing a non-blob $object does not
      make sense.
      
      Also add a couple of tests demonstrating expected behavior.
      Suggested-by: default avatarJunio C Hamano <[email protected]>
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      ce8daa1e
  3. 19 May, 2011 3 commits
    • Junio C Hamano's avatar
      notes remove: --stdin reads from the standard input · 46538012
      Junio C Hamano authored
      Teach the command to read object names to remove from the standard
      input, in addition to the object names given from the command line.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      46538012
    • Junio C Hamano's avatar
      notes remove: --ignore-missing · 2d370d2f
      Junio C Hamano authored
      Depending on the application, it is not necessarily an error for an object
      to lack a note, especially if the only thing the caller wants to make sure
      is that notes are cleared for an object.  By passing this option from the
      command line, the "git notes remove" command considers it a success if the
      object did not have any note to begin with.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      2d370d2f
    • Junio C Hamano's avatar
      notes remove: allow removing more than one · c3ab1a8e
      Junio C Hamano authored
      While "xargs -n1 git notes rm" is certainly a possible way to remove notes
      from many objects, this would create one notes "commit" per removal, which
      is not quite suitable for seasonal housekeeping.
      
      Allow taking more than one on the command line, and record their removal
      as a single atomic event if everthing goes well.
      
      Even though the old code insisted that "git notes rm" must be given only
      one object (or zero, in which case it would default to HEAD), this
      condition was not tested. Add tests to handle the new case where we feed
      multiple objects, and also make sure if there is a bad input, no change
      is recorded.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      c3ab1a8e
  4. 30 Mar, 2011 1 commit
    • Johan Herland's avatar
      Make "git notes add" more user-friendly when there are existing notes · 84a7e35e
      Johan Herland authored
      Currently, "notes add" (without -f/--force) will abort when the given object
      already has existing notes. This makes sense for the modes of "git notes add"
      that would necessarily overwrite the old message (when using the -m/-F/-C/-c
      options). However, when no options are given (meaning the notes are created
      from scratch in the editor) it is not very user-friendly to abort on existing
      notes, and forcing the user to run "git notes edit".
      
      Instead, it is better to simply "redirect" to "git notes edit" automatically,
      i.e. open the existing notes in the editor and let the user edit them.
      This patch does just that.
      
      This changes the behavior of "git notes add" without options when notes
      already exist for the given object, but I doubt that many users really depend
      on the previous failure from "git notes add" in this case.
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      84a7e35e
  5. 29 Mar, 2011 2 commits
    • Jeff King's avatar
      revision.c: make --no-notes reset --notes list · 92e0d425
      Jeff King authored
      With most command line options, later instances of an option
      override earlier ones. With cumulative options like
      "--notes", however, there is no way to say "forget the
      --notes I gave you before".
      
      Let's have --no-notes trigger this forgetting, so that:
      
        git log --notes=foo --no-notes --notes=bar
      
      will show only the "bar" notes.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      92e0d425
    • Jeff King's avatar
      revision.c: support --notes command-line option · 7249e912
      Jeff King authored
      We already have --show-notes, but it has a few shortcomings:
      
        1. Using --show-notes=<ref> implies that we should also
           show the default notes. Which means you also need to
           use --no-standard-notes if you want to suppress them.
      
        2. It is negated by --no-notes, which doesn't match.
      
        3. It's too long to type. :)
      
      This patch introduces --notes, which behaves exactly like
      --show-notes, except that using "--notes=<ref>" does not
      imply showing the default notes.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      7249e912
  6. 06 Jan, 2011 1 commit
  7. 17 Nov, 2010 2 commits
  8. 09 Nov, 2010 2 commits
  9. 31 Aug, 2010 1 commit
  10. 21 Jul, 2010 1 commit
  11. 20 Jul, 2010 1 commit
  12. 28 Jun, 2010 1 commit
  13. 18 Apr, 2010 1 commit
  14. 30 Mar, 2010 2 commits
  15. 13 Mar, 2010 4 commits
  16. 25 Feb, 2010 1 commit
  17. 14 Feb, 2010 11 commits
  18. 21 Jan, 2010 2 commits
  19. 20 Oct, 2009 2 commits
    • Johan Herland's avatar
      Teach "-m <msg>" and "-F <file>" to "git notes edit" · d9246d43
      Johan Herland authored
      The "-m" and "-F" options are already the established method
      (in both git-commit and git-tag) to specify a commit/tag message
      without invoking the editor. This patch teaches "git notes edit"
      to respect the same options for specifying a notes message without
      invoking the editor.
      
      Multiple "-m" and/or "-F" options are concatenated as separate
      paragraphs.
      
      The patch also updates the "git notes" documentation and adds
      selftests for the new functionality. Unfortunately, the added
      selftests include a couple of lines with trailing whitespace
      (without these the test will fail). This may cause git to warn
      about "whitespace errors".
      
      This patch has been improved by the following contributions:
      - Thomas Rast: fix trailing whitespace in t3301
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      d9246d43
    • Johannes Schindelin's avatar
      Add a script to edit/inspect notes · 65d9fb48
      Johannes Schindelin authored
      The script 'git notes' allows you to edit and show commit notes, by
      calling either
      
      	git notes show <commit>
      
      or
      
      	git notes edit <commit>
      
      This patch has been improved by the following contributions:
      - Tor Arne Vestbø: fix printing of multi-line notes
      - Michael J Gruber: test and handle empty notes gracefully
      - Thomas Rast:
        - only clean up message file when editing
        - use GIT_EDITOR and core.editor over VISUAL/EDITOR
        - t3301: fix confusing quoting in test for valid notes ref
        - t3301: use test_must_fail instead of !
        - refuse to edit notes outside refs/notes/
      - Junio C Hamano: tests: fix "export var=val"
      - Christian Couder: documentation: fix 'linkgit' macro in "git-notes.txt"
      - Johan Herland: minor cleanup and bugfixing in git-notes.sh (v2)
      Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
      Signed-off-by: default avatarTor Arne Vestbø <[email protected]>
      Signed-off-by: default avatarMichael J Gruber <[email protected]>
      Signed-off-by: default avatarThomas Rast <[email protected]>
      Signed-off-by: Christian Couder's avatarChristian Couder <[email protected]>
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      65d9fb48