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

Creating diffs

From
RRRocco Rutte <pdmef@gmx.net>
Date
Aug 3, 2006, 12:29 UTC
Message-ID
<20060803122937.GI5016@robert.daprodeges.fqdn.th-h.de>
Hi,

when creating a diff between two branches, one particular file needs a manually created/modified diff (the file contains just 1 line). As I cannot exclude files from the diff and create the missing one manually, I tried using the opposite approach: include all wanted.

However, when I do:
   $ git diff source:file dest:file
I get:
   --- a/source:file
   +++ b/source:file

But I'd like to drop the branchname. Can I do that without filtering everything through sed(1)?

Also, I think the diffs are reversed:
   $ git diff master:builtin-rm.c appname:builtin-rm.c
   diff --git a/master:builtin-rm.c b/master:builtin-rm.c
   index 735f3db..92d205a 100644
   --- a/master:builtin-rm.c
   +++ b/master:builtin-rm.c
   @@ -50,7 +50,6 @@ int cmd_rm(int argc, const char **argv, 
           const char **pathspec;
           char *seen;
   
   -       git_set_appname("git-rm");
           git_config(git_default_config);
   
           newfd = hold_lock_file_for_update(&lock_file, get_index_file());
since the appname branch contains the change while master doesn't.
Git version is 1.4.2.rc2 but both "bugs" happen with unpatched 1.3, too.
   bye, Rocco
-- 
:wq!
Next: Jakub Narebski
Message 1 of 6 in “Creating diffs”
  1. Rocco RutteAug 3, 2006
  2. Jakub NarebskiAug 3, 2006
  3. Jakub NarebskiAug 3, 2006
  4. Rocco RutteAug 3, 2006
  5. Junio C HamanoAug 3, 2006
  6. Junio C HamanoAug 3, 2006

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.