1. 06 11月, 2018 11 次提交
    • J
      apply: return -1 from option callback instead of calling exit(1) · 735ca208
      Jeff King 提交于
      The option callback for "apply --whitespace" exits with status "1" on
      error. It makes more sense for it to just return an error to
      parse-options. That code will exit, too, but it will use status "129"
      that is customary for option errors.
      
      The exit() dates back to aaf6c447 (builtin/apply: make
      parse_whitespace_option() return -1 instead of die()ing, 2016-08-08).
      That commit gives no reason why we'd prefer the current exit status (it
      looks like it was just bumping the "die" up a level in the callstack,
      but did not go as far as it could have).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      735ca208
    • J
      cat-file: report an error on multiple --batch options · 0eb8d376
      Jeff King 提交于
      The options callback for --batch and --batch-check detects when the two
      mutually incompatible options are used. But it simply returns an error
      code to parse-options, meaning the program will quit without any kind of
      message to the user.
      
      Instead, let's use error() to print something and return -1. Note that
      this flips the error return from 1 to -1, but negative values are more
      idiomatic here (and parse-options treats them the same).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0eb8d376
    • J
      tag: mark "--message" option with NONEG · 1f5db32d
      Jeff King 提交于
      We do not allow "--no-message" to work now, as the option callback
      returns "-1" when it sees a NULL arg. However, that will cause
      parse-options to exit(129) without printing anything further, leaving
      the user confused about what happened.
      
      Instead, let's explicitly mark it as PARSE_OPT_NONEG, which will give a
      useful error message (and print the usual -h output).
      
      In theory this could be used to override an earlier "-m", but it's not
      clear how it would interact with other message options (e.g., would it
      also clear data read for "-F"?). Since it's already disabled and nobody
      is asking for it, let's punt on that and just improve the error message.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1f5db32d
    • J
      show-branch: mark --reflog option as NONEG · 403d2ba5
      Jeff King 提交于
      Running "git show-branch --no-reflog" will behave as if "--reflog" was
      given with no options, which makes no sense.
      
      In theory this option might be used to cancel an earlier "--reflog"
      option, but the semantics are not clear. Let's punt on it and just
      disallow the broken option.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      403d2ba5
    • J
      format-patch: mark "--no-numbered" option with NONEG · 964fd83b
      Jeff King 提交于
      We have separate parse-options entries for "numbered" and "no-numbered",
      which means that we accept "--no-no-numbered". It does not behave
      sensibly, though (it ignores the "unset" flag and acts like
      "--no-numbered").
      
      We could fix that, but obviously this is silly and unintentional. Let's
      just disallow it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      964fd83b
    • J
      status: mark --find-renames option with NONEG · d6627fb8
      Jeff King 提交于
      If you run "git status --no-find-renames", it will behave the same as
      "--find-renames", because we ignore the "unset" parameter (we see a NULL
      "arg", but since the score argument is optional, we just think that the
      user did not provide a score).
      
      We already have a separate "--no-renames" to disable renames, so there's
      not much point in supporting "--no-find-renames". Let's just flag it as
      an error.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d6627fb8
    • J
      cat-file: mark batch options with NONEG · 0ad1efb4
      Jeff King 提交于
      Running "cat-file --no-batch" will behave as if "--batch" was given,
      since the option callback does not handle the "unset" flag (likewise for
      "--no-batch-check").
      
      In theory this might be used to cancel an earlier --batch, but it's not
      immediately obvious how that would interact with --batch-check. Let's
      just disallow the negated form of both options.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0ad1efb4
    • J
      pack-objects: mark index-version option as NONEG · f53c163b
      Jeff King 提交于
      Running "git pack-objects --no-index-version" will segfault, since the
      callback is not prepared to handle the "unset" flag.
      
      In theory this might be used to counteract an earlier "--index-version",
      or override a pack.indexversion config setting. But the semantics aren't
      immediately obvious, and it's unlikely anybody wants this. Let's just
      disable the broken option for now.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f53c163b
    • J
      ls-files: mark exclude options as NONEG · ccf659e8
      Jeff King 提交于
      Running "git ls-files --no-exclude" will currently segfault, as its
      option callback does not handle the "unset" parameter.
      
      In theory this could be used to clear the exclude list, but it is not
      clear how that would interact with the other exclude options, nor is the
      current code capable of clearing the list. Let's just disable the broken
      option.
      
      Note that --no-exclude-from will similarly segfault, but
      --no-exclude-standard will not. It just silently does the wrong thing
      (pretending as if --exclude-standard was specified).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ccf659e8
    • J
      am: handle --no-patch-format option · fce56648
      Jeff King 提交于
      Running "git am --no-patch-format" will currently segfault, since it
      tries to parse a NULL argument. Instead, let's have it cancel any
      previous --patch-format option.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fce56648
    • J
      apply: mark include/exclude options as NONEG · d5d20253
      Jeff King 提交于
      The options callback for "git apply --no-include" is not ready to handle
      the "unset" parameter, and as a result will segfault when it adds a NULL
      argument to the include list (likewise for "--no-exclude").
      
      In theory this might be used to clear the list, but since both
      "--include" and "--exclude" add to the same list, it's not immediately
      obvious what the semantics should be. Let's punt on that for now and
      just disallow the broken options.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d5d20253
  2. 02 11月, 2018 20 次提交
    • J
      Merge branch 'jc/http-curlver-warnings' · cd69ec8c
      Junio C Hamano 提交于
      Warning message fix.
      
      * jc/http-curlver-warnings:
        http: give curl version warnings consistently
      cd69ec8c
    • J
      Merge branch 'js/mingw-http-ssl' · d7b18597
      Junio C Hamano 提交于
      On platforms with recent cURL library, http.sslBackend configuration
      variable can be used to choose a different SSL backend at runtime.
      The Windows port uses this mechanism to switch between OpenSSL and
      Secure Channel while talking over the HTTPS protocol.
      
      * js/mingw-http-ssl:
        http: when using Secure Channel, ignore sslCAInfo by default
        http: add support for disabling SSL revocation checks in cURL
        http: add support for selecting SSL backends at runtime
      d7b18597
    • J
      Merge branch 'mg/gpg-fingerprint' · 11cc180f
      Junio C Hamano 提交于
      New "--pretty=format:" placeholders %GF and %GP that show the GPG
      key fingerprints have been invented.
      
      * mg/gpg-fingerprint:
        gpg-interface.c: obtain primary key fingerprint as well
        gpg-interface.c: support getting key fingerprint via %GF format
        gpg-interface.c: use flags to determine key/signer info presence
      11cc180f
    • J
      Merge branch 'mg/gpg-parse-tighten' · 02561896
      Junio C Hamano 提交于
      Detect and reject a signature block that has more than one GPG
      signature.
      
      * mg/gpg-parse-tighten:
        gpg-interface.c: detect and reject multiple signatures on commits
      02561896
    • J
      Merge branch 'en/merge-cleanup-more' · ff8e25e9
      Junio C Hamano 提交于
      Further clean-up of merge-recursive machinery.
      
      * en/merge-cleanup-more:
        merge-recursive: avoid showing conflicts with merge branch before HEAD
        merge-recursive: improve auto-merging messages with path collisions
      ff8e25e9
    • J
      Eighth batch for 2.20 · d582ea20
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d582ea20
    • J
      rebase: apply cocci patch · b17ca8f9
      Junio C Hamano 提交于
      Favor oideq() over !oidcmp() when checking for equality.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b17ca8f9
    • J
      Merge branch 'js/rebase-i-shortopt' · 85fcf1cb
      Junio C Hamano 提交于
      "git rebase -i" learned to take 'b' as the short form of 'break'
      option in the todo list.
      
      * js/rebase-i-shortopt:
        rebase -i: recognize short commands without arguments
      85fcf1cb
    • J
      Merge branch 'js/rebase-i-break' · 789b1f70
      Junio C Hamano 提交于
      "git rebase -i" learned a new insn, 'break', that the user can
      insert in the to-do list.  Upon hitting it, the command returns
      control back to the user.
      
      * js/rebase-i-break:
        rebase -i: introduce the 'break' command
        rebase -i: clarify what happens on a failed `exec`
      789b1f70
    • J
      Merge branch 'js/rebase-autostash-fix' · b78c5fe9
      Junio C Hamano 提交于
      "git rebase" that has recently been rewritten in C had a few issues
      in its "--autstash" feature, which have been corrected.
      
      * js/rebase-autostash-fix:
        rebase --autostash: fix issue with dirty submodules
        rebase --autostash: demonstrate a problem with dirty submodules
        rebase (autostash): use an explicit OID to apply the stash
        rebase (autostash): store the full OID in <state-dir>/autostash
        rebase (autostash): avoid duplicate call to state_dir_path()
      b78c5fe9
    • J
      Merge branch 'cb/printf-empty-format' · 9d322282
      Junio C Hamano 提交于
      Build fix for a topic in flight.
      
      * cb/printf-empty-format:
        sequencer: cleanup for gcc warning in non developer mode
      9d322282
    • J
      Merge branch 'jc/rebase-in-c-5-test-typofix' · 7ce32f72
      Junio C Hamano 提交于
      Typofix.
      
      * jc/rebase-in-c-5-test-typofix:
        rebase: fix typoes in error messages
      7ce32f72
    • J
      Merge branch 'pk/rebase-in-c-6-final' · ee5e9043
      Junio C Hamano 提交于
      The final step of rewriting "rebase -i" in C.
      
      * pk/rebase-in-c-6-final:
        rebase: default to using the builtin rebase
      ee5e9043
    • J
      Merge branch 'js/rebase-in-c-5.5-work-with-rebase-i-in-c' · 4b3517ee
      Junio C Hamano 提交于
      "rebase" that has been rewritten learns the new calling convention
      used by "rebase -i" that was rewritten in C, tying the loose end
      between two GSoC topics that stomped on each other's toes.
      
      * js/rebase-in-c-5.5-work-with-rebase-i-in-c:
        builtin rebase: prepare for builtin rebase -i
      4b3517ee
    • J
      Merge branch 'pk/rebase-in-c-5-test' · fd1a9e90
      Junio C Hamano 提交于
      Rewrite "git rebase" in C.
      
      * pk/rebase-in-c-5-test:
        builtin rebase: error out on incompatible option/mode combinations
        builtin rebase: use no-op editor when interactive is "implied"
        builtin rebase: show progress when connected to a terminal
        builtin rebase: fast-forward to onto if it is a proper descendant
        builtin rebase: optionally pass custom reflogs to reset_head()
        builtin rebase: optionally auto-detect the upstream
      fd1a9e90
    • J
      Merge branch 'pk/rebase-in-c-4-opts' · 02931217
      Junio C Hamano 提交于
      Rewrite "git rebase" in C.
      
      * pk/rebase-in-c-4-opts:
        builtin rebase: support --root
        builtin rebase: add support for custom merge strategies
        builtin rebase: support `fork-point` option
        merge-base --fork-point: extract libified function
        builtin rebase: support --rebase-merges[=[no-]rebase-cousins]
        builtin rebase: support `--allow-empty-message` option
        builtin rebase: support `--exec`
        builtin rebase: support `--autostash` option
        builtin rebase: support `-C` and `--whitespace=<type>`
        builtin rebase: support `--gpg-sign` option
        builtin rebase: support `--autosquash`
        builtin rebase: support `keep-empty` option
        builtin rebase: support `ignore-date` option
        builtin rebase: support `ignore-whitespace` option
        builtin rebase: support --committer-date-is-author-date
        builtin rebase: support --rerere-autoupdate
        builtin rebase: support --signoff
        builtin rebase: allow selecting the rebase "backend"
      02931217
    • J
      Merge branch 'pk/rebase-in-c-3-acts' · 39f73315
      Junio C Hamano 提交于
      Rewrite "git rebase" in C.
      
      * pk/rebase-in-c-3-acts:
        builtin rebase: stop if `git am` is in progress
        builtin rebase: actions require a rebase in progress
        builtin rebase: support --edit-todo and --show-current-patch
        builtin rebase: support --quit
        builtin rebase: support --abort
        builtin rebase: support --skip
        builtin rebase: support --continue
      39f73315
    • J
      Merge branch 'pk/rebase-in-c-2-basic' · e0720a38
      Junio C Hamano 提交于
      Rewrite "git rebase" in C.
      
      * pk/rebase-in-c-2-basic:
        builtin rebase: support `git rebase <upstream> <switch-to>`
        builtin rebase: only store fully-qualified refs in `options.head_name`
        builtin rebase: start a new rebase only if none is in progress
        builtin rebase: support --force-rebase
        builtin rebase: try to fast forward when possible
        builtin rebase: require a clean worktree
        builtin rebase: support the `verbose` and `diffstat` options
        builtin rebase: support --quiet
        builtin rebase: handle the pre-rebase hook and --no-verify
        builtin rebase: support `git rebase --onto A...B`
        builtin rebase: support --onto
      e0720a38
    • J
      Merge branch 'ag/rebase-i-in-c' · b49ef560
      Junio C Hamano 提交于
      Rewrite of the remaining "rebase -i" machinery in C.
      
      * ag/rebase-i-in-c:
        rebase -i: move rebase--helper modes to rebase--interactive
        rebase -i: remove git-rebase--interactive.sh
        rebase--interactive2: rewrite the submodes of interactive rebase in C
        rebase -i: implement the main part of interactive rebase as a builtin
        rebase -i: rewrite init_basic_state() in C
        rebase -i: rewrite write_basic_state() in C
        rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C
        rebase -i: implement the logic to initialize $revisions in C
        rebase -i: remove unused modes and functions
        rebase -i: rewrite complete_action() in C
        t3404: todo list with commented-out commands only aborts
        sequencer: change the way skip_unnecessary_picks() returns its result
        sequencer: refactor append_todo_help() to write its message to a buffer
        rebase -i: rewrite checkout_onto() in C
        rebase -i: rewrite setup_reflog_action() in C
        sequencer: add a new function to silence a command, except if it fails
        rebase -i: rewrite the edit-todo functionality in C
        editor: add a function to launch the sequence editor
        rebase -i: rewrite append_todo_help() in C
        sequencer: make three functions and an enum from sequencer.c public
      b49ef560
    • J
      Merge branch 'pk/rebase-in-c' · 5ae50845
      Junio C Hamano 提交于
      Rewrite of the "rebase" machinery in C.
      
      * pk/rebase-in-c:
        builtin/rebase: support running "git rebase <upstream>"
        rebase: refactor common shell functions into their own file
        rebase: start implementing it as a builtin
      5ae50845
  3. 30 10月, 2018 9 次提交