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

Re: [PATCH 2/4] backup_file dummy function

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 8, 2013, 02:45 UTC
Message-ID
<CACsJy8BfUJL6C2tignfgP5iQq2Egz03ZL7vDvVBJpaFWtD3XNQ@mail.gmail.com>
In-Reply-To
<1375884049-14961-3-git-send-email-stefanbeller@googlemail.com>

On Wed, Aug 7, 2013 at 9:00 PM, Stefan Beller <stefanbeller@googlemail.com> wrote:

Show 17 quoted lines
> ---
>  pack-write.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/pack-write.c b/pack-write.c
> index e6aa7e3..b728ea2 100644
> --- a/pack-write.c
> +++ b/pack-write.c
> @@ -344,6 +344,11 @@ struct sha1file *create_tmp_packfile(char **pack_tmp_name)
>         return sha1fd(fd, *pack_tmp_name);
>  }
>
> +void backup_file(char *filename)
> +{
> +
> +}
> +
I think the function looks like this (before it got lost after rebase)
+static void backup_file(const char *path)
+{
+       struct stat st;
+       if (repack_flags & REPACK_IN_PROGRESS &&
+           !stat(path, &st)) {
+               struct strbuf old = STRBUF_INIT;
+               strbuf_addf(&old, "%s.old", path);
+               if (rename(path, old.buf))
+                       die_errno("unable to rename pack %s", path);
+               string_list_append(&backup_files, strbuf_detach(&old, NULL));
+       }
+}
+
-- 
Duy
Previous: Stefan BellerNext: Stefan Beller
Message 13 of 17 in “Rewriting git-repack.sh in C”
  1. Stefan BellerAug 2, 2013
  2. Duy NguyenAug 2, 2013
  3. Duy NguyenAug 2, 2013
  4. Fredrik GustafssonAug 3, 2013
  5. Duy NguyenAug 3, 2013
  6. 0/4 Re: Rewriting git-repack.sh in CStefan Beller, Aug 7, 2013
  7. 1/4 Build in git-repackStefan Beller, Aug 7, 2013
  8. Matthieu MoyAug 7, 2013
  9. Junio C HamanoAug 7, 2013
  10. Stefan BellerAug 7, 2013
  11. Duy NguyenAug 8, 2013
  12. 2/4 backup_file dummy functionStefan Beller, Aug 7, 2013
  13. Duy NguyenAug 8, 2013
  14. 3/4 pack-objects: do not print usage when repackingStefan Beller, Aug 7, 2013
  15. Antoine PelisseAug 8, 2013
  16. 4/4 repack: add unpack-unreachableStefan Beller, Aug 7, 2013
  17. Matthieu MoyAug 5, 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.