1. 09 1月, 2019 15 次提交
    • J
      prefer "hash mismatch" to "sha1 mismatch" · 01f8d594
      Jeff King 提交于
      To future-proof ourselves against a change in the hash, let's use the
      more generic "hash mismatch" to refer to integrity problems. Note that
      we do advertise this exact string in git-fsck(1). However, the message
      itself is marked for translation, meaning we do not expect it to be
      machine-readable.
      
      While we're touching that documentation, let's also update it for
      grammar and clarity.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      01f8d594
    • J
      sha1-file: avoid "sha1 file" for generic use in messages · 2c319886
      Jeff King 提交于
      These error messages say "sha1 file", which is vague and not common in
      user-facing documentation. Unlike the conversions from the previous
      commit, these do not always refer to loose objects.
      
      In finalize_object_file() we could be dealing with a packfile. Let's
      just say "unable to write file" instead; since we include the filename,
      the nature of the file is clear from the rest of the message.
      
      In force_object_loose(), we're calling into read_object(), which could
      actually be _any_ type of object. Just say "object".
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2c319886
    • J
      sha1-file: prefer "loose object file" to "sha1 file" in messages · 76011357
      Jeff King 提交于
      When we're reporting an error for a loose object, let's use that term.
      It's more consistent with other parts of Git, and it is future-proof
      against changes to the hash function.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      76011357
    • J
      sha1-file: drop has_sha1_file() · 5d3679ee
      Jeff King 提交于
      There are no callers left of has_sha1_file() or its with_flags()
      variant. Let's drop them, and convert has_object_file() from a wrapper
      into the "real" function. Ironically, the sha1 variant was just copying
      into an object_id internally, so the resulting code is actually shorter!
      
      We can also drop the coccinelle rules for catching has_sha1_file()
      callers. Since the function no longer exists, the compiler will do that
      for us.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5d3679ee
    • J
      convert has_sha1_file() callers to has_object_file() · 98374a07
      Jeff King 提交于
      The only remaining callers of has_sha1_file() actually have an object_id
      already. They can use the "object" variant, rather than dereferencing
      the hash themselves.
      
      The code changes here were completely generated by the included
      coccinelle patch.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      98374a07
    • J
      sha1-file: convert pass-through functions to object_id · d7a24573
      Jeff King 提交于
      These two static functions, read_object() and quick_has_loose(), both
      have to hashcpy() their bare-sha1 arguments into object_id structs to
      pass them along. Since all of their callers actually have object_id
      structs in the first place, we can eliminate the copying by adjusting
      their input parameters.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d7a24573
    • J
      sha1-file: modernize loose header/stream functions · 00a7760e
      Jeff King 提交于
      As with the open/map/close functions for loose objects that were
      recently converted, the functions for parsing the loose object stream
      use the name "sha1" and a bare "unsigned char *". Let's fix that so that
      unpack_sha1_header() becomes unpack_loose_header(), etc.
      
      These conversions are less clear-cut than the file access functions.
      You could argue that the they are parsing Git's canonical object format
      (i.e., "type size\0contents", over which we compute the hash), which is
      not strictly tied to loose storage. But in practice these functions are
      used only for loose objects, and using the term "loose_header" (instead
      of "object_header") distinguishes it from the object header found in
      packfiles (which contains the same information in a different format).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      00a7760e
    • J
      sha1-file: modernize loose object file functions · 514c5fdd
      Jeff King 提交于
      The loose object access code in sha1-file.c is some of the oldest in
      Git, and could use some modernizing. It mostly uses "unsigned char *"
      for object ids, which these days should be "struct object_id".
      
      It also uses the term "sha1_file" in many functions, which is confusing.
      The term "loose_objects" is much better. It clearly distinguishes
      them from packed objects (which didn't even exist back when the name
      "sha1_file" came into being). And it also distinguishes it from the
      checksummed-file concept in csum-file.c (which until recently was
      actually called "struct sha1file"!).
      
      This patch converts the functions {open,close,map,stat}_sha1_file() into
      open_loose_object(), etc, and switches their sha1 arguments for
      object_id structs. Similarly, path functions like fill_sha1_path()
      become fill_loose_path() and use object_ids.
      
      The function sha1_loose_object_info() already says "loose", so we can
      just drop the "sha1" (and teach it to use object_id).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      514c5fdd
    • J
      http: use struct object_id instead of bare sha1 · f0be0db1
      Jeff King 提交于
      The dumb-http walker code still passes around and stores object ids as
      "unsigned char *sha1". Let's modernize it.
      
      There's probably still more work to be done to handle dumb-http fetches
      with a new, larger hash. But that can wait; this is enough that we can
      now convert some of the low-level object routines that we call into from
      here (and in fact, some of the "oid.hash" references added here will be
      further improved in the next patch).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f0be0db1
    • J
      update comment references to sha1_object_info() · c93206b4
      Jeff King 提交于
      Commit abef9020 (sha1_file: convert sha1_object_info* to object_id,
      2018-03-12) renamed the function to oid_object_info(), but missed some
      comments which mention it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c93206b4
    • J
      sha1-file: fix outdated sha1 comment references · cb1c8d1d
      Jeff King 提交于
      Commit 17e65451 (sha1_file: convert check_sha1_signature to struct
      object_id, 2018-03-12) switched to using the name "oid", but forgot to
      update the variable name in the comment.
      
      Likewise, b4f5aca4 (sha1_file: convert read_sha1_file to struct
      object_id, 2018-03-12) dropped the name read_sha1_file(), but missed a
      comment which mentions it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cb1c8d1d
    • R
      object-store: retire odb_load_loose_cache() · 8be88dbc
      René Scharfe 提交于
      Inline odb_load_loose_cache() into its only remaining caller,
      odb_loose_cache().  The latter offers a nicer interface for loading the
      cache, as it doesn't require callers to deal with fanout directory
      numbers directly.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8be88dbc
    • R
      object-store: use one oid_array per subdirectory for loose cache · 4cea1ce0
      René Scharfe 提交于
      The loose objects cache is filled one subdirectory at a time as needed.
      It is stored in an oid_array, which has to be resorted after each add
      operation.  So when querying a wide range of objects, the partially
      filled array needs to be resorted up to 255 times, which takes over 100
      times longer than sorting once.
      
      Use one oid_array for each subdirectory.  This ensures that entries have
      to only be sorted a single time.  It also avoids eight binary search
      steps for each cache lookup as a small bonus.
      
      The cache is used for collision checks for the log placeholders %h, %t
      and %p, and we can see the change speeding them up in a repository with
      ca. 100 objects per subdirectory:
      
      $ git count-objects
      26733 objects, 68808 kilobytes
      
      Test                        HEAD^             HEAD
      --------------------------------------------------------------------
      4205.1: log with %H         0.51(0.47+0.04)   0.51(0.49+0.02) +0.0%
      4205.2: log with %h         0.84(0.82+0.02)   0.60(0.57+0.03) -28.6%
      4205.3: log with %T         0.53(0.49+0.04)   0.52(0.48+0.03) -1.9%
      4205.4: log with %t         0.84(0.80+0.04)   0.60(0.59+0.01) -28.6%
      4205.5: log with %P         0.52(0.48+0.03)   0.51(0.50+0.01) -1.9%
      4205.6: log with %p         0.85(0.78+0.06)   0.61(0.56+0.05) -28.2%
      4205.7: log with %h-%h-%h   0.96(0.92+0.03)   0.69(0.64+0.04) -28.1%
      Reported-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4cea1ce0
    • R
      object-store: factor out odb_clear_loose_cache() · d4e19e51
      René Scharfe 提交于
      Add and use a function for emptying the loose object cache, so callers
      don't have to know any of its implementation details.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d4e19e51
    • R
      object-store: factor out odb_loose_cache() · 0000d654
      René Scharfe 提交于
      Add and use a function for loading the entries of a loose object
      subdirectory for a given object ID.  It frees callers from deriving the
      fanout key; they can use the returned oid_array reference for lookups or
      forward range scans.
      Suggested-by: NJeff King <peff@peff.net>
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0000d654
  2. 05 1月, 2019 12 次提交
    • J
      First batch after 2.20.1 · ecbdaf08
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ecbdaf08
    • J
      Merge branch 'mk/http-backend-kill-children-before-exit' · ea8620b4
      Junio C Hamano 提交于
      The http-backend CGI process did not correctly clean up the child
      processes it spawns to run upload-pack etc. when it dies itself,
      which has been corrected.
      
      * mk/http-backend-kill-children-before-exit:
        http-backend: enable cleaning up forked upload/receive-pack on exit
      ea8620b4
    • J
      Merge branch 'sd/stash-wo-user-name' · 1328d299
      Junio C Hamano 提交于
      A properly configured username/email is required under
      user.useConfigOnly in order to create commits; now "git stash"
      (even though it creates commit objects to represent stash entries)
      command is exempt from the requirement.
      
      * sd/stash-wo-user-name:
        stash: tolerate missing user identity
      1328d299
    • J
      Merge branch 'sg/clone-initial-fetch-configuration' · 84d17831
      Junio C Hamano 提交于
      Refspecs configured with "git -c var=val clone" did not propagate
      to the resulting repository, which has been corrected.
      
      * sg/clone-initial-fetch-configuration:
        Documentation/clone: document ignored configuration variables
        clone: respect additional configured fetch refspecs during initial fetch
        clone: use a more appropriate variable name for the default refspec
      84d17831
    • J
      Merge branch 'nd/checkout-dwim-fix' · 8d7f9dbf
      Junio C Hamano 提交于
      "git checkout frotz" (without any double-dash) avoids ambiguity by
      making sure 'frotz' cannot be interpreted as a revision and as a
      path at the same time.  This safety has been updated to check also
      a unique remote-tracking branch 'frotz' in a remote, when dwimming
      to create a local branch 'frotz' out of a remote-tracking branch
      'frotz' from a remote.
      
      * nd/checkout-dwim-fix:
        checkout: disambiguate dwim tracking branches and local files
      8d7f9dbf
    • J
      Merge branch 'ab/push-dwim-dst' · 0a84724b
      Junio C Hamano 提交于
      "git push $there $src:$dst" rejects when $dst is not a fully
      qualified refname and not clear what the end user meant.  The
      codepath has been taught to give a clearer error message, and also
      guess where the push should go by taking the type of the pushed
      object into account (e.g. a tag object would want to go under
      refs/tags/).
      
      * ab/push-dwim-dst:
        push doc: document the DWYM behavior pushing to unqualified <dst>
        push: test that <src> doesn't DWYM if <dst> is unqualified
        push: add an advice on unqualified <dst> push
        push: move unqualified refname error into a function
        push: improve the error shown on unqualified <dst> push
        i18n: remote.c: mark error(...) messages for translation
        remote.c: add braces in anticipation of a follow-up change
      0a84724b
    • J
      Merge branch 'en/fast-export-import' · 4d597532
      Junio C Hamano 提交于
      Small fixes and features for fast-export and fast-import, mostly on
      the fast-export side.
      
      * en/fast-export-import:
        fast-export: add a --show-original-ids option to show original names
        fast-import: remove unmaintained duplicate documentation
        fast-export: add --reference-excluded-parents option
        fast-export: ensure we export requested refs
        fast-export: when using paths, avoid corrupt stream with non-existent mark
        fast-export: move commit rewriting logic into a function for reuse
        fast-export: avoid dying when filtering by paths and old tags exist
        fast-export: use value from correct enum
        git-fast-export.txt: clarify misleading documentation about rev-list args
        git-fast-import.txt: fix documentation for --quiet option
        fast-export: convert sha1 to oid
      4d597532
    • J
      Merge branch 'nd/the-index' · cde55548
      Junio C Hamano 提交于
      More codepaths become aware of working with in-core repository
      instance other than the default "the_repository".
      
      * nd/the-index: (22 commits)
        rebase-interactive.c: remove the_repository references
        rerere.c: remove the_repository references
        pack-*.c: remove the_repository references
        pack-check.c: remove the_repository references
        notes-cache.c: remove the_repository references
        line-log.c: remove the_repository reference
        diff-lib.c: remove the_repository references
        delta-islands.c: remove the_repository references
        cache-tree.c: remove the_repository references
        bundle.c: remove the_repository references
        branch.c: remove the_repository reference
        bisect.c: remove the_repository reference
        blame.c: remove implicit dependency the_repository
        sequencer.c: remove implicit dependency on the_repository
        sequencer.c: remove implicit dependency on the_index
        transport.c: remove implicit dependency on the_index
        notes-merge.c: remove implicit dependency the_repository
        notes-merge.c: remove implicit dependency on the_index
        list-objects.c: reduce the_repository references
        list-objects-filter.c: remove implicit dependency on the_index
        ...
      cde55548
    • J
      Merge branch 'jk/loose-object-cache' · 3b2f8a02
      Junio C Hamano 提交于
      Code clean-up with optimization for the codepath that checks
      (non-)existence of loose objects.
      
      * jk/loose-object-cache:
        odb_load_loose_cache: fix strbuf leak
        fetch-pack: drop custom loose object cache
        sha1-file: use loose object cache for quick existence check
        object-store: provide helpers for loose_objects_cache
        sha1-file: use an object_directory for the main object dir
        handle alternates paths the same as the main object dir
        sha1_file_name(): overwrite buffer instead of appending
        rename "alternate_object_database" to "object_directory"
        submodule--helper: prefer strip_suffix() to ends_with()
        fsck: do not reuse child_process structs
      3b2f8a02
    • J
      Merge branch 'fc/http-version' · 13d99192
      Junio C Hamano 提交于
      The "http.version" configuration variable can be used with recent
      enough cURL library to force the version of HTTP used to talk when
      fetching and pushing.
      
      * fc/http-version:
        http: add support selecting http version
      13d99192
    • J
      Merge branch 'en/merge-path-collision' · ac193e0e
      Junio C Hamano 提交于
      Updates for corner cases in merge-recursive.
      
      * en/merge-path-collision:
        t6036: avoid non-portable "cp -a"
        merge-recursive: combine error handling
        t6036, t6043: increase code coverage for file collision handling
        merge-recursive: improve rename/rename(1to2)/add[/add] handling
        merge-recursive: use handle_file_collision for add/add conflicts
        merge-recursive: improve handling for rename/rename(2to1) conflicts
        merge-recursive: fix rename/add conflict handling
        merge-recursive: new function for better colliding conflict resolutions
        merge-recursive: increase marker length with depth of recursion
        t6036, t6042: testcases for rename collision of already conflicting files
        t6042: add tests for consistency in file collision conflict handling
      ac193e0e
    • J
      Merge branch 'nd/i18n' · 3813a89f
      Junio C Hamano 提交于
      More _("i18n") markings.
      
      * nd/i18n:
        fsck: mark strings for translation
        fsck: reduce word legos to help i18n
        parse-options.c: mark more strings for translation
        parse-options.c: turn some die() to BUG()
        parse-options: replace opterror() with optname()
        repack: mark more strings for translation
        remote.c: mark messages for translation
        remote.c: turn some error() or die() to BUG()
        reflog: mark strings for translation
        read-cache.c: add missing colon separators
        read-cache.c: mark more strings for translation
        read-cache.c: turn die("internal error") to BUG()
        attr.c: mark more string for translation
        archive.c: mark more strings for translation
        alias.c: mark split_cmdline_strerror() strings for translation
        git.c: mark more strings for translation
      3813a89f
  3. 15 12月, 2018 9 次提交
  4. 14 12月, 2018 2 次提交
  5. 13 12月, 2018 1 次提交
  6. 12 12月, 2018 1 次提交