This project is mirrored from https://git.kernel.org/pub/scm/git/git.git. Pull mirroring updated .
  1. 20 Nov, 2019 2 commits
    • Denton Liu's avatar
      pretty: implement 'reference' format · 1f0fc1db
      Denton Liu authored
      The standard format for referencing other commits within some projects
      (such as git.git) is the reference format. This is described in
      Documentation/SubmittingPatches as
      
      	If you want to reference a previous commit in the history of a stable
      	branch, use the format "abbreviated hash (subject, date)", like this:
      
      	....
      		Commit f86a3747 (pack-bitmap.c: fix a memleak, 2015-03-30)
      		noticed that ...
      	....
      
      Since this format is so commonly used, standardize it as a pretty
      format.
      
      The tests that are implemented essentially show that the format-string
      does not change in response to various log options. This is useful
      because, for future developers, it shows that we've considered the
      limitations of the "canned format-string" approach and we are fine with
      them.
      Based-on-a-patch-by: Gábor Szeder's avatarSZEDER Gábor <[email protected]>
      Signed-off-by: Denton Liu's avatarDenton Liu <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1f0fc1db
    • Denton Liu's avatar
      rev-list-options.txt: remove reference to --show-notes · 9d45ac4c
      Denton Liu authored
      In ab18b2c0 ("log/pretty-options: Document --[no-]notes and deprecate
      old notes options", 2011-03-30), the `--show-notes` option was
      deprecated. However, this reference to it still remains. Change it to
      reference the replacement option: `--notes`.
      Signed-off-by: Denton Liu's avatarDenton Liu <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      9d45ac4c
  2. 10 Nov, 2019 1 commit
    • Pratyush Yadav's avatar
      git-shortlog.txt: include commit limiting options · 461caf3e
      Pratyush Yadav authored
      git-shortlog, like git-log, supports options to filter what commits are
      used to generate the log. These options come from git-rev-list, and are
      documented in Documentation/rev-list-options.txt. Include those options
      in shortlog's documentation.
      
      But since rev-list-options.txt contains some other options that don't
      really apply in the context of shortlog (like diff formatting, commit
      ordering, etc), add a switch in rev-list-options.txt that excludes those
      sections from the shortlog documentation. To be more specific, include
      only the "Commit Limiting" and "History Simplification" sections.
      Signed-off-by: Pratyush Yadav's avatarPratyush Yadav <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      461caf3e
  3. 01 Jul, 2019 1 commit
    • Jeff King's avatar
      check_everything_connected: assume alternate ref tips are valid · 39b44ba7
      Jeff King authored
      When we receive a remote ref update to sha1 "X", we want to check that
      we have all of the objects needed by "X". We can assume that our
      repository is not currently corrupted, and therefore if we have a ref
      pointing at "Y", we have all of its objects. So we can stop our
      traversal from "X" as soon as we hit "Y".
      
      If we make the same non-corruption assumption about any repositories we
      use to store alternates, then we can also use their ref tips to shorten
      the traversal.
      
      This is especially useful when cloning with "--reference", as we
      otherwise do not have any local refs to check against, and have to
      traverse the whole history, even though the other side may have sent us
      few or no objects. Here are results for the included perf test (which
      shows off more or less the maximal savings, getting one new commit and
      sharing the whole history):
      
      Test                        HEAD^             HEAD
      --------------------------------------------------------------------
      [on git.git]
      5600.3: clone --reference   2.94(2.86+0.08)   0.09(0.08+0.01) -96.9%
      [on linux.git]
      5600.3: clone --reference   45.74(45.34+0.41)   0.36(0.30+0.08) -99.2%
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      39b44ba7
  4. 28 Jun, 2019 1 commit
  5. 20 Jun, 2019 1 commit
    • Emily Shaffer's avatar
      rev-list: teach --no-object-names to enable piping · 42357b4e
      Emily Shaffer authored
      Allow easier parsing by cat-file by giving rev-list an option to print
      only the OID of a non-commit object without any additional information.
      This is a short-term shim; later on, rev-list should be taught how to
      print the types of objects it finds in a format similar to cat-file's.
      
      Before this commit, the output from rev-list needed to be massaged
      before being piped to cat-file, like so:
      
        git rev-list --objects HEAD | cut -f 1 -d ' ' |
          git cat-file --batch-check
      
      This was especially unexpected when dealing with root trees, as an
      invisible whitespace exists at the end of the OID:
      
        git rev-list --objects --filter=tree:1 --max-count=1 HEAD |
          xargs -I% echo "AA%AA"
      
      Now, it can be piped directly, as in the added test case:
      
        git rev-list --objects --no-object-names HEAD | git cat-file --batch-check
      Signed-off-by: Emily Shaffer's avatarEmily Shaffer <[email protected]>
      Change-Id: I489bdf0a8215532e540175188883ff7541d70e1b
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      42357b4e
  6. 29 May, 2019 1 commit
    • Christian Couder's avatar
      list-objects-filter: disable 'sparse:path' filters · e693237e
      Christian Couder authored
      If someone wants to use as a filter a sparse file that is in the
      repository, something like "--filter=sparse:oid=<ref>:<path>"
      already works.
      
      So 'sparse:path' is only interesting if the sparse file is not in
      the repository. In this case though the current implementation has
      a big security issue, as it makes it possible to ask the server to
      read any file, like for example /etc/password, and to explore the
      filesystem, as well as individual lines of files.
      
      If someone is interested in using a sparse file that is not in the
      repository as a filter, then at the minimum a config option, such
      as "uploadpack.sparsePathFilter", should be implemented first to
      restrict the directory from which the files specified by
      'sparse:path' can be read.
      
      For now though, let's just disable 'sparse:path' filters.
      Helped-by: default avatarMatthew DeVore <[email protected]>
      Helped-by: default avatarJeff Hostetler <[email protected]>
      Signed-off-by: Christian Couder's avatarChristian Couder <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e693237e
  7. 01 Apr, 2019 1 commit
  8. 07 Mar, 2019 1 commit
  9. 08 Feb, 2019 1 commit
    • Elijah Newren's avatar
      log,diff-tree: add --combined-all-paths option · d76ce4f7
      Elijah Newren authored
      The combined diff format for merges will only list one filename, even if
      rename or copy detection is active.  For example, with raw format one
      might see:
      
        ::100644 100644 100644 fabadb8 cc95eb0 4866510 MM	describe.c
        ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM	bar.sh
        ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR	phooey.c
      
      This doesn't let us know what the original name of bar.sh was in the
      first parent, and doesn't let us know what either of the original names
      of phooey.c were in either of the parents.  In contrast, for non-merge
      commits, raw format does provide original filenames (and a rename score
      to boot).  In order to also provide original filenames for merge
      commits, add a --combined-all-paths option (which must be used with
      either -c or --cc, and is likely only useful with rename or copy
      detection active) so that we can print tab-separated filenames when
      renames are involved.  This transforms the above output to:
      
        ::100644 100644 100644 fabadb8 cc95eb0 4866510 MM	desc.c	desc.c	desc.c
        ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM	foo.sh	bar.sh	bar.sh
        ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR	fooey.c	fuey.c	phooey.c
      
      Further, in patch format, this changes the from/to headers so that
      instead of just having one "from" header, we get one for each parent.
      For example, instead of having
      
        --- a/phooey.c
        +++ b/phooey.c
      
      we would see
      
        --- a/fooey.c
        --- a/fuey.c
        +++ b/phooey.c
      Signed-off-by: Elijah Newren's avatarElijah Newren <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      d76ce4f7
  10. 23 Jan, 2019 1 commit
  11. 22 Jan, 2019 1 commit
    • Stephen P. Smith's avatar
      Add 'human' date format documentation · 038a8788
      Stephen P. Smith authored
      Display date and time information in a format similar to how people
      write dates in other contexts. If the year isn't specified then, the
      reader infers the date is given is in the current year.
      
      By not displaying the redundant information, the reader concentrates
      on the information that is different. The patch reports relative dates
      based on information inferred from the date on the machine running the
      git command at the time the command is executed.
      
      While the format is more useful to humans by dropping inferred
      information, there is nothing that makes it actually human. If the
      'relative' date format wasn't already implemented then using
      'relative' would have been appropriate.
      Signed-off-by: default avatarStephen P. Smith <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      038a8788
  12. 15 Jan, 2019 1 commit
    • Matthew DeVore's avatar
      list-objects-filter: teach tree:# how to handle >0 · c813a7c3
      Matthew DeVore authored
      Implement positive values for <depth> in the tree:<depth> filter. The
      exact semantics are described in Documentation/rev-list-options.txt.
      
      The long-term goal at the end of this is to allow a partial clone to
      eagerly fetch an entire directory of files by fetching a tree and
      specifying <depth>=1. This, for instance, would make a build operation
      fast and convenient. It is fast because the partial clone does not need
      to fetch each file individually, and convenient because the user does
      not need to supply a sparse-checkout specification.
      
      Another way of considering this feature is as a way to reduce
      round-trips, since the client can get any number of levels of
      directories in a single request, rather than wait for each level of tree
      objects to come back, whose entries are used to construct a new request.
      Signed-off-by: default avatarMatthew DeVore <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      c813a7c3
  13. 26 Dec, 2018 1 commit
    • Martin Ågren's avatar
      Documentation: do not nest open blocks · ad1f243a
      Martin Ågren authored
      It appears we try to nest open blocks, but that does not work well with
      Asciidoctor, which fails to indent the inner blocks. As a result, they
      do not visually seem to relate (as much) to the preceding paragraph as
      they should. Drop the outer blocks to fix the rendering of the inner
      ones. Asciidoc renders identically before and after this patch, both
      man-pages and html.
      
      This also makes Asciidoctor stop rendering a literal '+' before "Under
      --pretty=oneline ..." in the manuals for git-log and git-rev-list.
      Signed-off-by: default avatarMartin Ågren <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      ad1f243a
  14. 23 Oct, 2018 1 commit
  15. 06 Oct, 2018 1 commit
    • Matthew DeVore's avatar
      list-objects-filter: implement filter tree:0 · bc5975d2
      Matthew DeVore authored
      Teach list-objects the "tree:0" filter which allows for filtering
      out all tree and blob objects (unless other objects are explicitly
      specified by the user). The purpose of this patch is to allow smaller
      partial clones.
      
      The name of this filter - tree:0 - does not explicitly specify that
      it also filters out all blobs, but this should not cause much confusion
      because blobs are not at all useful without the trees that refer to
      them.
      
      I also considered only:commits as a name, but this is inaccurate because
      it suggests that annotated tags are omitted, but actually they are
      included.
      
      The name "tree:0" allows later filtering based on depth, i.e. "tree:1"
      would filter out all but the root tree and blobs. In order to avoid
      confusion between 0 and capital O, the documentation was worded in a
      somewhat round-about way that also hints at this future improvement to
      the feature.
      Signed-off-by: default avatarMatthew DeVore <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      bc5975d2
  16. 08 Dec, 2017 1 commit
    • Jonathan Tan's avatar
      rev-list: support termination at promisor objects · df11e196
      Jonathan Tan authored
      Teach rev-list to support termination of an object traversal at any
      object from a promisor remote (whether one that the local repo also has,
      or one that the local repo knows about because it has another promisor
      object that references it).
      
      This will be used subsequently in gc and in the connectivity check used
      by fetch.
      
      For efficiency, if an object is referenced by a promisor object, and is
      in the local repo only as a non-promisor object, object traversal will
      not stop there. This is to avoid building the list of promisor object
      references.
      
      (In list-objects.c, the case where obj is NULL in process_blob() and
      process_tree() do not need to be changed because those happen only when
      there is a conflict between the expected type and the existing object.
      If the object doesn't exist, an object will be synthesized, which is
      fine.)
      Signed-off-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      df11e196
  17. 05 Dec, 2017 1 commit
  18. 22 Nov, 2017 1 commit
    • Jeff Hostetler's avatar
      rev-list: add list-objects filtering support · caf3827e
      Jeff Hostetler authored
      Teach rev-list to use the filtering provided by the
      traverse_commit_list_filtered() interface to omit
      unwanted objects from the result.
      
      Object filtering is only allowed when one of the "--objects*"
      options are used.
      
      When the "--filter-print-omitted" option is used, the omitted
      objects are printed at the end.  These are marked with a "~".
      This option can be combined with "--quiet" to get a list of
      just the omitted objects.
      
      Add t6112 test.
      
      In the future, we will introduce a "partial clone" mechanism
      wherein an object in a repo, obtained from a remote, may
      reference a missing object that can be dynamically fetched from
      that remote once needed.  This "partial clone" mechanism will
      have a way, sometimes slow, of determining if a missing link
      is one of the links expected to be produced by this mechanism.
      
      This patch introduces handling of missing objects to help
      debugging and development of the "partial clone" mechanism,
      and once the mechanism is implemented, for a power user to
      perform operations that are missing-object aware without
      incurring the cost of checking if a missing link is expected.
      Signed-off-by: default avatarJeff Hostetler <[email protected]>
      Reviewed-by: default avatarJonathan Tan <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      caf3827e
  19. 16 Nov, 2017 1 commit
    • Stefan Beller's avatar
      revision.h: introduce blob/tree walking in order of the commits · ce5b6f9b
      Stefan Beller authored
      The functionality to list tree objects in the order they were seen
      while traversing the commits will be used in one of the next commits,
      where we teach `git describe` to describe not only commits, but blobs, too.
      
      The change in list-objects.c is rather minimal as we'll be re-using
      the infrastructure put in place of the revision walking machinery. For
      example one could expect that add_pending_tree is not called, but rather
      commit->tree is directly passed to the tree traversal function. This
      however requires a lot more code than just emptying the queue containing
      trees after each commit.
      Signed-off-by: Stefan Beller's avatarStefan Beller <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      ce5b6f9b
  20. 27 Oct, 2017 1 commit
  21. 24 Aug, 2017 1 commit
  22. 15 Jun, 2017 1 commit
    • René Scharfe's avatar
      strbuf: let strbuf_addftime handle %z and %Z itself · c3fbf81a
      René Scharfe authored
      There is no portable way to pass timezone information to strftime.  Add
      parameters for timezone offset and name to strbuf_addftime and let it
      handle the timezone-related format specifiers %z and %Z internally.
      
      Callers can opt out for %Z by passing NULL as timezone name.  %z is
      always handled internally -- this helps on Windows, where strftime would
      expand it to a timezone name (same as %Z), in violation of POSIX.
      Modifiers are not handled, e.g. %Ez is still passed to strftime.
      
      Use an empty string as timezone name in show_date (the only current
      caller) for now because we only have the timezone offset in non-local
      mode.  POSIX allows %Z to resolve to an empty string in case of missing
      information.
      Helped-by: Ulrich Müller's avatarUlrich Mueller <[email protected]>
      Helped-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarRene Scharfe <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      c3fbf81a
  23. 26 May, 2017 1 commit
    • Ævar Arnfjörð Bjarmason's avatar
      log: add -P as a synonym for --perl-regexp · 7531a2dd
      Ævar Arnfjörð Bjarmason authored
      Add a short -P option as a synonym for the longer --perl-regexp, for
      consistency with the options the corresponding grep invocations
      accept.
      
      This was intentionally omitted in commit 727b6fc3 ("log --grep:
      accept --basic-regexp and --perl-regexp", 2012-10-03) for unspecified
      future use.
      
      Make it consistent with "grep" rather than to keep it open for future
      use, and to avoid the confusion of -P meaning different things for
      grep & log, as is the case with the -G option.
      
      As noted in the aforementioned commit the --basic-regexp option can't
      have a corresponding -G argument, as the log command already uses that
      for -G<regex>.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      7531a2dd
  24. 20 May, 2017 1 commit
    • Ævar Arnfjörð Bjarmason's avatar
      grep & rev-list doc: stop promising libpcre for --perl-regexp · d048cb13
      Ævar Arnfjörð Bjarmason authored
      Stop promising in our grep & rev-list options documentation that we're
      always going to be using libpcre when given the --perl-regexp option.
      
      Instead talk about using "Perl-compatible regular expressions" and
      using these types of patterns using "a compile-time dependency".
      
      Saying "libpcre" means that we're talking about libpcre.so, which is
      always going to be v1. This change is part of an ongoing saga to add
      support for libpcre2, which comes with PCRE v2.
      
      In the future we might use some completely unrelated library to
      provide perl-compatible regular expression support. By wording the
      documentation differently and not promising any specific version of
      PCRE or even PCRE at all we have more wiggle room to change the
      implementation.
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      d048cb13
  25. 08 Feb, 2017 1 commit
  26. 27 Sep, 2016 1 commit
  27. 27 Jul, 2016 3 commits
    • Junio C Hamano's avatar
      date: clarify --date=raw description · 442f6fd3
      Junio C Hamano authored
      "... in the internal raw Git format `%s %z` format." was clunky in
      repeating "format" twice, and would not have helped those who do not
      immediately get that these are strftime(3) conversion specifiers.
      
      Explain them with words, and demote the mention of `%s %z` to a
      hint to help those who know them.
      Helped-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      442f6fd3
    • Jeff King's avatar
      date: add "unix" format · 642833db
      Jeff King authored
      We already have "--date=raw", which is a Unix epoch
      timestamp plus a contextual timezone (either the author's or
      the local). But one may not care about the timezone and just
      want the epoch timestamp by itself. It's not hard to parse
      the two apart, but if you are using a pretty-print format,
      you may want git to show the "finished" form that the user
      will see.
      
      We can accomodate this by adding a new date format, "unix",
      which is basically "raw" without the timezone.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      642833db
    • Jeff King's avatar
      date: document and test "raw-local" mode · 1a2a1e8e
      Jeff King authored
      The "raw" format shows a Unix epoch timestamp, but with a
      timezone tacked on. The timestamp is not _in_ that zone, but
      it is extra information about the time (by default, the zone
      the author was in).
      
      The documentation claims that "raw-local" does not work. It
      does, but the end result is rather subtle. Let's describe it
      in better detail, and test to make sure it works (namely,
      the epoch time doesn't change, but the zone does).
      
      While we are rewording the documentation in this area, let's
      not use the phrase "does not work" for the remaining option,
      "--date=relative". It's vague; do we accept it or not? We do
      accept it, but it has no effect (which is a reasonable
      outcome). We should also refer to the option not as
      "--relative" (which is the historical synonym, and does not
      take "-local" at all), but as "--date=relative".
      Helped-by: Jakub Narębski's avatarJakub Narębski <[email protected]>
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1a2a1e8e
  28. 22 Jul, 2016 2 commits
  29. 20 Jul, 2016 2 commits
  30. 28 Jun, 2016 1 commit
  31. 03 Sep, 2015 2 commits
  32. 24 Aug, 2015 1 commit
    • Jeff King's avatar
      rev-list: make it obvious that we do not support notes · 2aea7a51
      Jeff King authored
      The rev-list command does not have the internal
      infrastructure to display notes. Running:
      
        git rev-list --notes HEAD
      
      will silently ignore the "--notes" option. Running:
      
        git rev-list --notes --grep=. HEAD
      
      will crash on an assert. Running:
      
        git rev-list --format=%N HEAD
      
      will place a literal "%N" in the output (it does not even
      expand to an empty string).
      
      Let's have rev-list tell the user that it cannot fill the
      user's request, rather than silently producing wrong data.
      Likewise, let's remove mention of the notes options from the
      rev-list documentation.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      2aea7a51
  33. 29 Jun, 2015 1 commit
  34. 17 Apr, 2015 1 commit