git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/8] sha1_file: allow to select pack origin when looking up an object

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Apr 30, 2013, 06:01 UTC
Message-ID
<CAPig+cTiSAzusYmh6YrtZH_FB3Ap8Xrg-+Od-y_Jjj84MMW1og@mail.gmail.com>
In-Reply-To
<1367293372-1958-2-git-send-email-pclouds@gmail.com>

On Mon, Apr 29, 2013 at 11:42 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:

Show 20 quoted lines
> diff --git a/cache.h b/cache.h
> index 94ca1ac..bed403a 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -744,12 +744,33 @@ char *strip_path_suffix(const char *path, const char *suffix);
>  int daemon_avoid_alias(const char *path);
>  int offset_1st_component(const char *path);
>
> +/*
> + * odb origin bit mask:
> + * - 8 low bits are for requested objects
> + * - 8 high bits are for their base objects
> + */
> +#define ODB_LOCAL      1
> +#define ODB_ALT                2
> +#define ODB_CACHED     4
> +/*
> + * This flag is used to track if the origin selection is from
> + * "odb_default" below. Not a real source, not to be passed to any
> + * function cals explicitly.
s/cals/calls/
Show 20 quoted lines
> + */
> +#define ODB_DEFAULT    8
> +
> +extern unsigned int odb_default;
> +
>  /* object replacement */
>  #define READ_SHA1_FILE_REPLACE 1
> -extern void *read_sha1_file_extended(const unsigned char *sha1, enum object_type *type, unsigned long *size, unsigned flag);
> +extern void *read_sha1_file_extended(const unsigned char *sha1,
> +                                    unsigned int origin,
> +                                    enum object_type *type,
> +                                    unsigned long *size,
> +                                    unsigned flag);
>  static inline void *read_sha1_file(const unsigned char *sha1, enum object_type *type, unsigned long *size)
>  {
> -       return read_sha1_file_extended(sha1, type, size, READ_SHA1_FILE_REPLACE);
> +       return read_sha1_file_extended(sha1, odb_default, type, size, READ_SHA1_FILE_REPLACE);
>  }
>  extern const unsigned char *do_lookup_replace_object(const unsigned char *sha1);
>  static inline const unsigned char *lookup_replace_object(const unsigned char *sha1)
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 3 of 14 in “Some object db protection when add_submodule_odb is used”
  1. 0/8 Some object db protection when add_submodule_odb is usedNguyễn Thái Ngọc Duy, Apr 30, 2013
  2. 1/8 sha1_file: allow to select pack origin when looking up an objectNguyễn Thái Ngọc Duy, Apr 30, 2013
  3. Eric SunshineApr 30, 2013
  4. 2/8 sha1_file: keep track of alternate source of objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  5. 3/8 sha1_file: mark alt object database from add_submodule_odb()Nguyễn Thái Ngọc Duy, Apr 30, 2013
  6. Eric SunshineApr 30, 2013
  7. 4/8 sha1_file: new object source for submodule's alt object databaseNguyễn Thái Ngọc Duy, Apr 30, 2013
  8. Eric SunshineApr 30, 2013
  9. 5/8 commit.c: refuse to write commits referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  10. 6/8 cache-tree.c: refuse to write trees referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  11. 7/8 mktag: refuse to write tags referring to external objectsNguyễn Thái Ngọc Duy, Apr 30, 2013
  12. 8/8 sha1_file: do write objects even if found in ODB_EXTALT databaseNguyễn Thái Ngọc Duy, Apr 30, 2013
  13. Thomas RastApr 30, 2013
  14. Duy NguyenApr 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.