1. 04 6月, 2019 2 次提交
  2. 31 5月, 2019 10 次提交
  3. 30 5月, 2019 3 次提交
    • N
      parse-options: check empty value in OPT_INTEGER and OPT_ABBREV · f7e68a08
      Nguyễn Thái Ngọc Duy 提交于
      When parsing the argument for OPT_INTEGER and OPT_ABBREV, we check if we
      can parse the entire argument to a number with "if (*s)". There is one
      missing check: if "arg" is empty to begin with, we fail to notice.
      
      This could happen with long option by writing like
      
        git diff --inter-hunk-context= blah blah
      
      Before 16ed6c97 (diff-parseopt: convert --inter-hunk-context,
      2019-03-24), --inter-hunk-context is handled by a custom parser
      opt_arg() and does detect this correctly.
      
      This restores the bahvior for --inter-hunk-context and make sure all
      other integer options are handled the same (sane) way. For OPT_ABBREV
      this is new behavior. But it makes it consistent with the rest.
      
      PS. OPT_MAGNITUDE has similar code but git_parse_ulong() does detect
      empty "arg". So it's good to go.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7e68a08
    • N
      diff-parseopt: restore -U (no argument) behavior · 8ef05193
      Nguyễn Thái Ngọc Duy 提交于
      Before d473e2e0 (diff.c: convert -U|--unified, 2019-01-27), -U and
      --unified are implemented with a custom parser opt_arg() in diff.c. I
      didn't check this code carefully and not realize that it's the
      equivalent of PARSE_OPT_NONEG | PARSE_OPT_OPTARG.
      
      In other words, if -U is specified without any argument, the option
      should be accepted, and the default value should be used. Without
      PARSE_OPT_OPTARG, parse_options() will reject this case and cause a
      regression.
      Reported-by: NBryan Turner <bturner@atlassian.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ef05193
    • N
      diff-parseopt: correct variable types that are used by parseopt · 7f125ff9
      Nguyễn Thái Ngọc Duy 提交于
      Most number-related OPT_ macros store the value in an 'int'
      variable. Many of the variables in 'struct diff_options' have a
      different type, but during the conversion to using parse_options() I
      failed to notice and correct.
      
      The problem was reported on s360x which is a big-endian
      architechture. The variable to store '-w' option in this case is
      xdl_opts, 'long' type, 8 bytes. But since parse_options() assumes
      'int' (4 bytes), it will store bits in the wrong part of xdl_opts. The
      problem was found on little-endian platforms because parse_options()
      will accidentally store at the right part of xdl_opts.
      
      There aren't much to say about the type change (except that 'int' for
      xdl_opts should still be big enough, since Windows' long is the same
      size as 'int' and nobody has complained so far). Some safety checks may
      be implemented in the future to prevent class of bugs.
      Reported-by: NTodd Zullinger <tmz@pobox.com>
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7f125ff9
  4. 29 5月, 2019 10 次提交
    • J
      rebase docs: recommend `-r` over `-p` · 7948b49a
      Johannes Schindelin 提交于
      The `--preserve-merges` option is now deprecated in favor of
      `--rebase-merges`; Let's stop recommending the former.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7948b49a
    • J
      docs: say that `--rebase=preserve` is deprecated · 7401ab92
      Johannes Schindelin 提交于
      As of Git v2.22.0, the `--preserve-merges` backend of `git rebase` will
      be officially deprecated in favor of the `--rebase-merges` backend.
      Consequently, `git pull --rebase=preserve` will also be deprected. State
      this explicitly.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7401ab92
    • J
      tests: mark a couple more test cases as requiring `rebase -p` · db4a3f26
      Johannes Schindelin 提交于
      The `--preserve-merges` option has been deprecated, and as a consequence
      we started to mark test cases that require that option to be supported,
      in preparation for removing that support eventually.
      
      Since we marked those test cases, a couple more crept into the test
      suite, and with this patch, we mark them, too.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      db4a3f26
    • J
      fetch-pack: send server options after command · 5b204b7d
      Jonathan Tan 提交于
      Currently, if any server options are specified during a protocol v2
      fetch, server options will be sent before "command=fetch". Write server
      options to the request buffer in send_fetch_request() so that the
      components of the request are sent in the correct order.
      
      The protocol documentation states that the command must come first. The
      Git server implementation in serve.c (see process_request() in that
      file) tolerates any order of command and capability, which is perhaps
      why we haven't noticed this. This was noticed when testing against a
      JGit server implementation, which follows the documentation in this
      regard.
      Signed-off-by: NJonathan Tan <jonathantanmy@google.com>
      Acked-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5b204b7d
    • J
      trace2: fix tracing when NO_PTHREADS is defined · 5fdae9d3
      Jeff Hostetler 提交于
      Teach trace2 TLS code to not rely on pthread_getspecific() when NO_PTHREADS
      is defined.  Instead, always assume the context data of the main thread.
      Signed-off-by: NJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5fdae9d3
    • J
      rebase: replace incorrect logical negation by correct bitwise one · 4c785c0e
      Johannes Schindelin 提交于
      In bff014da (builtin rebase: support the `verbose` and `diffstat`
      options, 2018-09-04), we added a line that wanted to remove the
      `REBASE_DIFFSTAT` bit from the flags, but it used an incorrect negation.
      
      Found by Coverity.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4c785c0e
    • S
      progress: avoid empty line when breaking the progress line · 1aed1a5f
      SZEDER Gábor 提交于
      Since commit 545dc345 (progress: break too long progress bar lines,
      2019-04-12) when splitting a too long progress line, sometimes it
      looks as if a superfluous empty line were added between the title
      line and the counters.
      
      To make sure that the previously displayed progress line is completely
      covered up when writing the new, shorter title line, we calculate how
      many characters need to be overwritten with spaces.  Alas, this
      calculation doesn't account for the newline character at the end of
      the new title line, and resulted in printing one more space than
      strictly necessary.  This extra space character doesn't matter, if the
      length of the previous progress line was shorter than the width of the
      terminal.  However, if the previous line matched the terminal width,
      then this extra space made the new line longer, effectively adding
      that empty line after the title line.
      
      Fix this off-by-one to avoid that spurious empty line.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1aed1a5f
    • S
      trace2: document the supported values of GIT_TRACE2* env variables · 4e0d3aa1
      SZEDER Gábor 提交于
      The descriptions of the GIT_TRACE2* environment variables link to the
      technical docs for further details on the supported values.  However,
      a link like this only really works if the docs are viewed in a browser
      and the full documentation is available.  OTOH, in 'man git' there are
      no links to conveniently click on, and distro-shipped git packages
      tend to include only the man pages, while the technical docs and the
      docs in html format are in a separate 'git-doc' package.
      
      So let's describe the supported values to make the manpage more
      self-contained, but still keep the references to the technical docs
      because the details of the SID, and the JSON and perf output formats
      are definitely beyond the scope of 'man git'.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4e0d3aa1
    • S
      trace2: rename environment variables to GIT_TRACE2* · e4b75d6a
      SZEDER Gábor 提交于
      For an environment variable that is supposed to be set by users, the
      GIT_TR2* env vars are just too unclear, inconsistent, and ugly.
      
      Most of the established GIT_* environment variables don't use
      abbreviations, and in case of the few that do (GIT_DIR,
      GIT_COMMON_DIR, GIT_DIFF_OPTS) it's quite obvious what the
      abbreviations (DIR and OPTS) stand for.  But what does TR stand for?
      Track, traditional, trailer, transaction, transfer, transformation,
      transition, translation, transplant, transport, traversal, tree,
      trigger, truncate, trust, or ...?!
      
      The trace2 facility, as the '2' suffix in its name suggests, is
      supposed to eventually supercede Git's original trace facility.  It's
      reasonable to expect that the corresponding environment variables
      follow suit, and after the original GIT_TRACE variables they are
      called GIT_TRACE2; there is no such thing is 'GIT_TR'.
      
      All trace2-specific config variables are, very sensibly, in the
      'trace2' section, not in 'tr2'.
      
      OTOH, we don't gain anything at all by omitting the last three
      characters of "trace" from the names of these environment variables.
      
      So let's rename all GIT_TR2* environment variables to GIT_TRACE2*,
      before they make their way into a stable release.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e4b75d6a
    • E
      gitsubmodules: align html and nroff lists · 8e9fe16c
      Emily Shaffer 提交于
      There appears to be a bug in the toolchain generating manpages from
      lettered lists. When a list is enumerated with letters, the resulting
      nroff shows numbers instead. Mostly this is harmless, but in the case of
      gitsubmodules, the paragraph following the list refers back to each
      bullet by letter. As a result, reading this documentation via `man
      gitsubmodules` is hard to parse - readers must infer that a bug exists
      and a refers to 1, b refers to 2, and c refers to 3 in the list above.
      
      The problem specifically was introduced in ad471949; previously rather
      than generating numerated lists the bulleted area was entirely
      monospaced in HTML and shown in plaintext in nroff.
      
      The bug seems to exist in docbook-xml - I've reported it on May 1 via
      the docbook-apps mail list - but for now it may make more sense to just
      work around the issue.
      Signed-off-by: NEmily Shaffer <emilyshaffer@google.com>
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e9fe16c
  5. 19 5月, 2019 15 次提交