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

Re: [PATCH 1/1] merge-file: add an option to process object IDs

From
Elijah Newren <newren@gmail.com>
Date
Oct 29, 2023, 06:17 UTC
Message-ID
<CABPp-BG9Y6aZ+TWdkL4QE9e12fu3n61V16G6DLtawEDe=g9F4w@mail.gmail.com>
In-Reply-To
<20231024195655.2413191-2-sandals@crustytoothpaste.net>
Hi,
Overall, looks good.  Just a couple questions...

On Tue, Oct 24, 2023 at 12:58 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:

>
> From: "brian m. carlson" <bk2204@github.com>
>
[...]
Show 9 quoted lines
> --- a/Documentation/git-merge-file.txt
> +++ b/Documentation/git-merge-file.txt
> @@ -12,6 +12,9 @@ SYNOPSIS
>  'git merge-file' [-L <current-name> [-L <base-name> [-L <other-name>]]]
>         [--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>]
>         [--[no-]diff3] <current-file> <base-file> <other-file>
> +'git merge-file' --object-id [-L <current-name> [-L <base-name> [-L <other-name>]]]
> +       [--ours|--theirs|--union] [-q|--quiet] [--marker-size=<n>]
> +       [--[no-]diff3] <current-oid> <base-oid> <other-oid>

Why was the `[-p|--stdout]` option removed in the second synopsis? Elsewhere you explicitly call it out as a possibility to be used with --object-id.

Also, why the extra synopsis instead of just adding a `[--object-id]` option to the previous one?

[...]
Show 12 quoted lines
> @@ -80,12 +88,21 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
>
>                 fname = prefix_filename(prefix, argv[i]);
>
> -               if (read_mmfile(mmf, fname))
> +               if (object_id) {
> +                       if (repo_get_oid(the_repository, argv[i], &oid))
> +                               ret = -1;
> +                       else if (!oideq(&oid, the_hash_algo->empty_blob))
> +                               read_mmblob(mmf, &oid);
> +                       else
> +                               read_mmfile(mmf, "/dev/null");

Does "/dev/null" have any portability considerations? (I really don't know; just curious.)

Previous: brian m. carlsonNext: Phillip Wood
Message 5 of 34 in “Object ID support for git merge-file”
  1. 0/1 Object ID support for git merge-filebrian m. carlson, Oct 24, 2023
  2. 1/1 merge-file: add an option to process object IDsbrian m. carlson, Oct 24, 2023
  3. Eric SunshineOct 24, 2023
  4. brian m. carlsonOct 24, 2023
  5. Elijah NewrenOct 29, 2023
  6. Phillip WoodOct 29, 2023
  7. brian m. carlsonOct 30, 2023
  8. brian m. carlsonOct 29, 2023
  9. Elijah NewrenOct 30, 2023
  10. Elijah NewrenOct 29, 2023
  11. Phillip WoodOct 29, 2023
  12. Taylor BlauOct 30, 2023
  13. brian m. carlsonOct 30, 2023
  14. Elijah NewrenOct 30, 2023
  15. 0/1 Object ID support for git merge-filebrian m. carlson, Oct 30, 2023
  16. 1/1 merge-file: add an option to process object IDsbrian m. carlson, Oct 30, 2023
  17. Martin ÅgrenOct 31, 2023
  18. brian m. carlsonOct 31, 2023
  19. Junio C HamanoNov 1, 2023
  20. brian m. carlsonNov 1, 2023
  21. Elijah NewrenOct 30, 2023
  22. Junio C HamanoOct 31, 2023
  23. Phillip WoodOct 31, 2023
  24. Junio C HamanoOct 31, 2023
  25. 0/2 Object ID support for git merge-filebrian m. carlson, Nov 1, 2023
  26. 1/2 git-merge-file doc: drop "-file" from argument placeholdersbrian m. carlson, Nov 1, 2023
  27. Junio C HamanoNov 1, 2023
  28. Martin ÅgrenNov 2, 2023
  29. brian m. carlsonNov 2, 2023
  30. Martin ÅgrenNov 2, 2023
  31. Junio C HamanoNov 2, 2023
  32. 2/2 merge-file: add an option to process object IDsbrian m. carlson, Nov 1, 2023
  33. Martin ÅgrenNov 2, 2023
  34. Junio C HamanoNov 1, 2023

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.