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

Re: format-patch: numbered patches from a patch list?

From
tom fogal <tfogal@alumni.unh.edu>
Date
Jul 22, 2009, 02:47 UTC
Message-ID
<auto-000020035969@sci.utah.edu>
In-Reply-To
<auto-000020035874@sci.utah.edu>
Answering my own question.
tom fogal <tfogal@alumni.unh.edu> writes:
> I have a need to generate a numbered sequence of patches from
> a sparse sprinkling of patches on a branch.  Is there a way to
> accomplish this?
Yep.  Duh.

Just generate the patches as I did in my my first mail. Then use mtime.sh:

    #!/bin/sh
    for patch in $@ ; do
      commitdate=$(head -n 5 ${patch} | \
                   grep "^Date" | \
                   cut -d: -f 2-)
      touch -d "${commitdate}" ${patch}
      shortfn=$(echo "${patch}" | cut -b 1-30)
      echo "Changed ${shortfn} to ${commitdate}"
    done

to change the modification time of every patch I care about. Now I can list the files by modification time, achieving exactly what I want.

I really love a full posix environment sometimes.
Sorry for the noise,
-tom
Previous: Jeff King
Message 4 of 4 in “format-patch: numbered patches from a patch list?”
  1. tom fogalJul 22, 2009
  2. Junio C HamanoJul 22, 2009
  3. Jeff KingJul 22, 2009
  4. tom fogalJul 22, 2009

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.