[git-users] git diff confusing: still showing ^M at end of some lines.

2021-12-29 Thread skybuck2000
I am trying to get rid of ^M in repository cause it kinda looks weird and 
may screw up diffs, I am not exactly sure what is going on.

git diff head~2

I see red lines:
- text 
- text
- text
I see green lines
+ same text or slightly changed ^m
+ same text or slightly changed ^m
+ same text or slightly changed ^m

Why is git showing ^m ?

According to documentation when auto-crlf is set to true git should replace 
end of line markers with LF

so why is CR still showing up in git diff  ?!?!?

Bye,
  Skybuck.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/59ed8b98-c82a-46a9-b48c-400fa5f6615en%40googlegroups.com.


[git-users] git diff color setup

2017-08-18 Thread Runjian Wu
Hi all,

I am a new git user. I used to be a hg user. I want to set up the color of 
git diff. I attached the hg diff color. I want the "meta" information set 
like hg diff (three different colors in "meta"). And if possible, how to 
add timestamp behind the old and new files?

Thanks,

Runjian Wu 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] 'git diff --name-status' reports difference for zero-byte file

2016-05-05 Thread Konstantin Khomoutov
On Thu, 5 May 2016 08:28:43 -0700 (PDT)
Jack Poon  wrote:

> We are working on an add-on over git using git filters, and testing
> other tools that encapsulate Git.
> 
> For some reason, git reports that there is difference for any
> zero-byte when git filters are used.
> 
> Is this a feature or bug?  What's the suggested workaround?

I can't verify this with Git 2.1.4 on a Debian Jessie running amd64.

Here's an annotated transcript of the sample session I've just
performed.  It creates a repository, configures a filter which
merely runs `/bin/cat` both for clean and smudge actions (hence
it performs what CS PhDs would call an "identity transformation"),
sets up a .gitattributes file which applies this filter to the files
matching the "*.txt" pattern, adds two zero-length files in two
adjacent commits and verifies the diff looks as expected.

Then we force checking out of these files and try again.

% git --version
git version 2.1.4

~% cd /tmp
tmp% git init filters
Initialized empty Git repository in /tmp/filters/.git/
tmp% cd filters
filters% git config --add --local filter.foo.smudge '/bin/cat'
filters% git config --add --local filter.foo.clean '/bin/cat'
filters% cat >.gitattributes
*.txt   filter=foo
filters% touch aaa.txt
filters% stat -c %s aaa.txt 
0
filters% git add aaa.txt
filters% git commit -m 'Add aaa.txt'
[master (root-commit) bec42c4] Add aaa.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 aaa.txt
filters% touch bbb.txt
filters% stat -c %s bbb.txt 
0
filters% git add bbb.txt
filters% git commit -m 'Add bbb.txt'
[master 5c30813] Add bbb.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 bbb.txt
filters% git diff --name-status HEAD~1 HEAD
A   bbb.txt

Observe that the diff output looks as expected: a single file
has been added.

Now let's force checking out these files to make them pass
through the smudge filter:

filters% rm aaa.txt bbb.txt 
filters% GIT_TRACE=1 git checkout -f -- .
20:45:08.515779 git.c:349   trace: built-in: git 'checkout'
'-f' '--' '.'
20:45:08.516375 run-command.c:341   trace: run_command: '/bin/cat'
20:45:08.516607 run-command.c:192   trace: exec: '/bin/cat'
20:45:08.517432 run-command.c:341   trace: run_command: '/bin/cat'
20:45:08.517633 run-command.c:192   trace: exec: '/bin/cat'

filters%  git diff --name-status HEAD~1 HEAD
A   bbb.txt

Again, the diff looks OK.

Let's diff to the index:

filters% git diff --staged
filters% 


Hence my take on your issue is that either you have a bug in your
filter code or a bug in Git (less likely).

I'd first try to debug this a little bug further.  Use GIT_TRACE
to verify what gets called on `git add` and `git checkout`.
Use `git ls-tree` and `git cat-file` to get hold onto individual
raw blobs representing the contents of the files in the repository,
verify they are really of size zero etc.

Also make sure you don't have execution bit flips on your files:
while Git does not track permission bits, it does track execution
bit and whether the file is a symlink or not.

If all will fail, contact the main Git list, but this time, please
be sure to include all the relevant details about the system you're
observing this on -- starting with the Git version.  See [1] for
more info.

1. https://gist.github.com/tfnico/4441562

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] 'git diff --name-status' reports difference for zero-byte file

2016-05-05 Thread Jack Poon
Hi,

We are working on an add-on over git using git filters, and testing other 
tools that encapsulate Git.

For some reason, git reports that there is difference for any zero-byte 
when git filters are used.

Is this a feature or bug?  What's the suggested workaround?

Best regards,
Jack

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git diff problem with cvs $id$

2015-07-06 Thread Konrád Lőrinczi

 

> So which repo contains expanded keywords?  If yours, then do a 
> recursive `sed` (or whatever) invocation on all that thousand of files 
> and make a single commit titled "Normalize CVS keywords".  Then merge 
> normally.  If the foreign repo contains expanded keywords, may be 
> `git rerere` might be of help -- it's specifically designed to remember 
> how you resolved past merge conflicts. 
>

There is a repo with original software.
I have a repo, which contains an installed software, which has expanded cvs 
keywords.
When I started development I did not use git, yet, so all developments were 
done on the installed version, which contained expanded cvs keywords.

So maybe you are right, I should run sed through all my repo, but I'm 
afraid I can not write a regular expression, which can absolutely safely 
replace cvs keywords.
For a thousand file, I can not be sure it will not break something.
This is why I forced the clean & smudge way.
 

Konrad

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git diff problem with cvs $id$

2015-07-06 Thread Konstantin Khomoutov
On Mon, 6 Jul 2015 11:53:26 -0700 (PDT)
Konrád Lőrinczi  wrote:

> > Remove the it!  If you aren't using CVS those lines serve no
> > purpose at all.  Even if you do use CVS the line is of dubious
> > usefulness. 
> 
> Unfortunately I can not remove them.
> They are in an earlier branch of a software repo, which has more
> thousand files.
> So I need a solution, where I can keep original repo, but still can
> merge with my fork, without solving conflicts in more thousand files
> because of cvs indents.

So which repo contains expanded keywords?  If yours, then do a
recursive `sed` (or whatever) invocation on all that thousand of files
and make a single commit titled "Normalize CVS keywords".  Then merge
normally.  If the foreign repo contains expanded keywords, may be
`git rerere` might be of help -- it's specifically designed to remember
how you resolved past merge conflicts.

Still, I can't completely comprehend your situation: the foreign repo
supposedly should contain unexpanded keywords because to me, the only
sensible way to get a repo with expanded keywords is to have it
converted from the source one using some brain-dead tool; or may be you
have just done `git add .` on a CVS checkout?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git diff problem with cvs $id$

2015-07-06 Thread Konrád Lőrinczi


> > Any suggestions? 
>
> Remove the it!  If you aren't using CVS those lines serve no purpose 
> at all.  Even if you do use CVS the line is of dubious usefulness. 
>

Unfortunately I can not remove them.
They are in an earlier branch of a software repo, which has more thousand 
files.
So I need a solution, where I can keep original repo, but still can merge 
with my fork, without solving conflicts in more thousand files because of 
cvs indents.


Konrad
 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git diff problem with cvs $id$

2015-07-02 Thread Konstantin Khomoutov
On Wed, 1 Jul 2015 06:37:12 -0700 (PDT)
Konrád Lőrinczi  wrote:

> I have two branches and the only difference between them is the cvs
> $id$, which is expanded in one branch and not expanded in the other. 
> 
> Is there a way to show git diff as unchanged? 
> Also should not show conflict in case of git merge. 

Two approaches:

1) Simply remove it from the files in both branches, as Magnus
   suggested.

   Another idea is to modify files only in the branch in which
   the tokens are expanded -- simply modify them back into "token"
   form to read just $Id$.

   After that change, the files will be byte-to-byte identical.

2) If you actually need this tokens expanded for real (that is, to
   contain some up-to-date information, read up on clean/smudge
   filters (use `git help attributes`).

   Basically, you'll need a pair of programs one of which would
   expand those tokens in the data it reads from its stdin
   and write the result to its stdout, and another one would do
   the reverse -- turning the $Id: blah blah$ back to just $Id$.
   This way you have files with expanded tokens in your work tree
   and files with normalized tokens in the repository.  Git will also
   take care to apply clean filters when you do plain `git diff` --
   thus comparing the file in the work tree to its version in the
   repository.

I'd say, usage of VCS keywords these days is questionable.
First, knowing which revision the file came from is only supposeldy
useful for non-compiled code (like programs written in Tcl, Perl, Python
etc), and for cases files could be somehow updated / checked out by the
user individually.
Second, given just the file without any expanded VCS keywords in it,
you still are able to guess which commit(s) it could have came from --
quick googling yields [1, 2] as the top two links.

1. http://stackoverflow.com/a/223890/720999
2. http://blog.endpoint.com/2014/11/finding-specific-git-commit-at-point-in.html

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git diff problem with cvs $id$

2015-07-02 Thread Magnus Therning
On Wed, Jul 01, 2015 at 06:37:12AM -0700, Konrád Lőrinczi wrote:
> I have two branches and the only difference between them is the cvs
> $id$, which is expanded in one branch and not expanded in the other. 
> 
> Is there a way to show git diff as unchanged? 

Not out of the box.  You could do some filtering using attributes.

> Also should not show conflict in case of git merge. 
> 
> 
> Any suggestions?

Remove the it!  If you aren't using CVS those lines serve no purpose
at all.  Even if you do use CVS the line is of dubious usefulness.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Eagles may soar, but weasels don't get sucked into jet engines.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[git-users] Git diff problem with cvs $id$

2015-07-01 Thread Konrád Lőrinczi
I have two branches and the only difference between them is the cvs $id$, 
which is expanded in one branch and not expanded in the other. 

Is there a way to show git diff as unchanged? 
Also should not show conflict in case of git merge. 


Any suggestions?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git diff - get all changes since a tag was applied

2015-05-03 Thread Gergely Polonkai
Hello,

I'm not sure I get what you need, but my first guess is to use `git log
tagname..` (mind the two dots). Also you may want to add --oneline.

Best,
Gergely
On 3 May 2015 17:06, "Demi Goldberg"  wrote:

>
> Hi All,
>
> I would like to find all the changes (change set list only ) between a
> specific tag and the head.
>
> I would like to know what was change in the project (changesets) since a
> tag I had created in the past for example.
>
> I saw the command:
> git format-patch 
>
> that create patch files for every change since that label , in my case I
> only want to see the list of changeset (patches) without creating the files.
>
> Which command should I run ?
>
>
> Thx,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] git diff - get all changes since a tag was applied

2015-05-03 Thread Demi Goldberg

Hi All,

I would like to find all the changes (change set list only ) between a 
specific tag and the head.

I would like to know what was change in the project (changesets) since a 
tag I had created in the past for example.

I saw the command: 
git format-patch  

that create patch files for every change since that label , in my case I 
only want to see the list of changeset (patches) without creating the files.

Which command should I run ?


Thx,

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git diff output..

2015-03-26 Thread Dale R. Worley
acppcoder  writes:
> Is there a way to make git diff show it's output in a format that can be 
> traversed by 'jump to next error' in an editor such as emacs. 

I'm not sure what you want.  If you put the output of git diff into an
Emacs buffer, and put the buffer into diff-mode, Emacs probably has the
functions you want.

It sounds like you want to give Emacs' C-x ! a git-diff command, and
then have C-x ` step through the diff hunks as if they are errors in a
compilation.  The Emacs documentation says

C-x ` normally uses the most recently started
compilation, grep, or occur buffer.  It can also operate on any
buffer with output from the C-x !, M-x grep commands, or,
more generally, on any buffer in Compilation mode or with
Compilation Minor mode enabled, or any buffer in which
`next-error-function' is bound to an appropriate function.
To specify use of a particular buffer for error messages, type
C-x ` in that buffer when it is the only one displayed
in the current frame.

So if you can arrange for your git-diff output to go into a buffer, set
the buffer into diff-mode and route next-error-function to execute
diff-hunk-next, you can probably get that functionality.

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] git diff output..

2015-03-22 Thread acppcoder
Is there a way to make git diff show it's output in a format that can be 
traversed by 'jump to next error' in an editor such as emacs. 

(e.g., imagine running it in an emacs compilation buffer, and use a hotkey 
to step through the difference locations in source code ... the output 
would show each location as "filename:line:column" , then the content & 
changed file below .. perhaps you could give it an option for number of 
lines of preceding context)

I realise this is only applicable when showing a diff of the current 
working tree & a previous commit, and an alternative would be to use a  git 
mode of some sort in the editor

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] git-diff-tree --root

2014-09-09 Thread Roman Neuhauser
hello,

git-diff-tree without --root is absolutely silent for the root commit,
and i see no bad effects of --root on non-root commits.  are there any
hidden gotchas?  IOW, why is the --root behavior not the default?

cram[1] testcase::

  $ git init -q scratch
  $ cd scratch
  $ echo '.*.sw?' > .gitignore
  $ git add .gitignore
  $ git commit -q -m init .gitignore

  $ git diff-tree HEAD

  $ git diff-tree --root HEAD
  [0-9a-z]{40} (re)
  :00 100644  [0-9a-z]{40} A\\t.* 
(re)

[1] https://pypi.python.org/pypi/cram

-- 
roman

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Git Diff

2014-08-02 Thread Magnus Therning
On 3 Aug 2014 01:52, "Anonymous"  wrote:
>
> Hi All,
>
> I'm new to Git. I generated a patch using "git diff > patch" command and
submitted the patch for one of the open source projects.
>
> The automated tool which applies these patches and tests them, returned
with below response. I don't understand what i'm doing wrong. I downloaded
the source recently.
>
> -1 Patch failed to apply to head of branch

I believe you might have more success with patches generated using 'git
format-patch'.

/M

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Git Diff

2014-08-02 Thread Anonymous
Hi All,

I'm new to Git. I generated a patch using "git diff > patch" command and 
submitted the patch for one of the open source projects. 

The automated tool which applies these patches and tests them, returned 
with below response. I don't understand what i'm doing wrong. I downloaded 
the source recently.

-1 Patch failed to apply to head of branch

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git diff -w --name-only does not work

2014-06-10 Thread Magnus Therning
On Mon, Jun 09, 2014 at 11:30:15PM -0700, André Hänsel wrote:
> When I run "git diff -w --name-only" I get a file listed. When I
> then run "git diff -w filename" I get no output. When I run "git
> diff filename" I see that there are whitespace changes.
> 
> How do I get the names of files with non-whitespace changes? Aren't
> -w --name-only the correct options?

It does look like you have found a bug; `-w` and `--name-only` does
not seem to play nice together:


% git --version
git version 2.0.0
% git diff
diff --git a/foo b/foo
index da91582..e1dac5f 100644
--- a/foo
+++ b/foo
@@ -1,3 +1,3 @@
-alsdkfja aldkfj kjfdlakjd aldfjal alsdjfla ldjalfaj
+alsdkfja  aldkfj kjfdlakjd aldfjal alsdjfla ldjalfaj
 aldkfj dalfjad lajdf ajfal  ljl asldfjal lajf aalkjad 
 alsdjfl akjdfl ajdfl adjajf aj.
% git diff -w
% git diff -w --name-only
foo


In the same vein, `-w` and `--name-status` doesn't seem to play well together
either:


% git diff --name-status -w
M   foo


It also seems `-b` suffers from similar problems when combined with
`--name-{only,status}`.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4 
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

In a hierarchy, every employee tends to rise to his level of incompetence.
 -- The Peter Principle


pgpNmwJeHu3DB.pgp
Description: PGP signature


[git-users] git diff -w --name-only does not work

2014-06-09 Thread André Hänsel
When I run "git diff -w --name-only" I get a file listed. When I then run 
"git diff -w filename" I get no output. When I run "git diff filename" I 
see that there are whitespace changes.

How do I get the names of files with non-whitespace changes? Aren't -w 
--name-only the correct options?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] git diff not showing details

2013-10-06 Thread Philip Oakley
Git thinks they are binary files. This is a symptom that they probably have 
null bytes (not ASCII text) in them and are probably unicode. You will need a 
diff tool that will cope with such unicode (assuming they are proper text 
files).

set the config options appropriately so that your text files use the diff tool 
of your choice.

Philip
  - Original Message - 
  From: Peter Pitchford 
  To: git-users@googlegroups.com 
  Sent: Sunday, October 06, 2013 4:15 PM
  Subject: [git-users] git diff not showing details


  Windows 7
  Git Bash or Command line, both act the same.

  When I change a file and then run git diff I get: 
  C:\workshop\git>git diff
  diff --git a/thirdfile.txt b/thirdfile.txt
  index 7caac66..f6eb45c 100644
  Binary files a/thirdfile.txt and b/thirdfile.txt differ

  How do I get it to show the lines that have been changed? 


  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] git diff not showing details

2013-10-06 Thread Peter Pitchford
Windows 7
Git Bash or Command line, both act the same.

When I change a file and then run *git diff* I get: 
C:\workshop\git>git diff
diff --git a/thirdfile.txt b/thirdfile.txt
index 7caac66..f6eb45c 100644
Binary files a/thirdfile.txt and b/thirdfile.txt differ

How do I get it to show the lines that have been changed? 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[git-users] "git diff" errors

2013-08-16 Thread Dale R. Worley
Using Git (1.7.7.6), it appears that if I run "git diff" in a
directory that is not part of a Git working copy, it produces this
error message:

$ git diff
usage: git diff [--no-index]  
$ 

1) This message doesn't tell the user what went wrong.  (Indeed,
invoking "git diff" with no arguments is valid in a working copy.)

2) The usage message is incorrect, in that the manual page lists four
fundamental invocation formats:

   git diff [options] [] [--] [...]
   git diff [options] --cached [] [--] [...]
   git diff [options]   [--] [...]
   git diff [options] [--no-index] [--]  

Am I correct here?

Dale

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 1:57 PM, Thomas Ferris Nicolaisen wrote:

> If you want to single down to the diff on a single file, there is no first 
> class way to do this in Git. You could do a feature request to the Git 
> developer list, and argue that it belongs in git diff. I agree that it would 
> be useful, but not sure the developers will feel the same way.

Interesting. It is odd to me that you can say git diff commit1..commit2 -- 
myFile and that this usually works but suddenly stops working merely because 
myFile got renamed somewhere between commit and commit2. It feels like breakage 
and it surprises me that the developers don't feel it that way (but obviously 
they don't, or they would have done something about it).

> Some GUI tools support showing the history of a single file. You can then 
> select two revisions and do a compare between the two.
> 
> I guess you could script it by parsing the output of a git log with the two 
> revisions and the filename in one of them, finding the old file-name, and 
> then using it in a second diff call.

Thanks. I think that's just what I'll do! m.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Thomas Ferris Nicolaisen
On Friday, February 15, 2013 9:04:25 PM UTC+1, Matt Neuburg wrote:

>
> On Feb 15, 2013, at 9:24 AM, Bob Hiestand > 
> wrote: 
>
> > your post didn't restrict the use to only filtering by path 
>
> It did; it showed an example of what I'm having to do, where I'm 
> explicitly comparing HEAD:newfile with oldCommit:oldfile. That is what I 
> need to do: compare a particular file with its version in the past. The 
> question is, is there a way to do this without my having to supply the old 
> name of the same file, every darned time. One thinks there should be, 
> because, after all, git does know the old name (as is proved by its ability 
> to log backwards through it). 
>
> Whenever one has to do something dumb and repetitive, a computer should be 
> doing it for you. That's what I'm asking for in this case. I have dozens of 
> these files to do these comparisons with, a lot. m. 
>
> PS It isn't my fault that the files were all renamed. Orders from on high, 
> don't you know.


If you are comparing many files in one diff, have a look 
at http://stackoverflow.com/questions/7759193/git-diff-renamed-file

If you want to single down to the diff on a single file, there is no first 
class way to do this in Git. You could do a feature request to the Git 
developer list , and argue that it 
belongs in git diff. I agree that it would be useful, but not sure the 
developers will feel the same way.

Some GUI tools support showing the history of a single file. You can then 
select two revisions and do a compare between the two.

I guess you could script it by parsing the output of a git log with the two 
revisions and the filename in one of them, finding the old file-name, and 
then using it in a second diff call.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 9:24 AM, Bob Hiestand  wrote:

> your post didn't restrict the use to only filtering by path

It did; it showed an example of what I'm having to do, where I'm explicitly 
comparing HEAD:newfile with oldCommit:oldfile. That is what I need to do: 
compare a particular file with its version in the past. The question is, is 
there a way to do this without my having to supply the old name of the same 
file, every darned time. One thinks there should be, because, after all, git 
does know the old name (as is proved by its ability to log backwards through 
it).

Whenever one has to do something dumb and repetitive, a computer should be 
doing it for you. That's what I'm asking for in this case. I have dozens of 
these files to do these comparisons with, a lot. m.

PS It isn't my fault that the files were all renamed. Orders from on high, 
don't you know.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Bob Hiestand
On Fri, Feb 15, 2013 at 10:31 AM, Matt Neuburg  wrote:

> > Have you tried the '-M' option to diff?
>
> Yes, have you? It seems to have no effect when you supply an explicit
> filename - presumably *because* you are supplying an explicit filename.
> That's exactly my point.
>
>
I have; your post didn't restrict the use to only filtering by path.  I
don't see a way to filter by path and allow it to work without scripting it
yourself.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Matt Neuburg

On Feb 15, 2013, at 7:48 AM, Bob Hiestand  wrote:

> 
> On Thu, Feb 14, 2013 at 8:02 PM, Matt Neuburg  wrote:
> My files have all been renamed, so to diff one of them to an earlier commit 
> I'm saying this sort of thing:
> 
> git diff HEAD:newname cb3e0a5fa8:oldname
> 
> I have to keep a list of the new names and old names beside me at all times. 
> This seems nuts. Is there a better way? Clearly git can tell from the history 
> when a file has been renamed, so why do I have to tell it the old name of 
> each file? Thx.
> 
> Have you tried the '-M' option to diff? 

Yes, have you? It seems to have no effect when you supply an explicit filename 
- presumably *because* you are supplying an explicit filename. That's exactly 
my point.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [git-users] git diff when file has been renamed

2013-02-15 Thread Bob Hiestand
On Thu, Feb 14, 2013 at 8:02 PM, Matt Neuburg  wrote:

> My files have all been renamed, so to diff one of them to an earlier
> commit I'm saying this sort of thing:
>
> git diff HEAD:newname cb3e0a5fa8:oldname
>
> I have to keep a list of the new names and old names beside me at all
> times. This seems nuts. Is there a better way? Clearly git can tell from
> the history when a file has been renamed, so why do I have to tell it the
> old name of each file? Thx.
>

Have you tried the '-M' option to diff?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[git-users] git diff when file has been renamed

2013-02-14 Thread Matt Neuburg
My files have all been renamed, so to diff one of them to an earlier commit 
I'm saying this sort of thing:

git diff HEAD:newname cb3e0a5fa8:oldname

I have to keep a list of the new names and old names beside me at all 
times. This seems nuts. Is there a better way? Clearly git can tell from 
the history when a file has been renamed, so why do I have to tell it the 
old name of each file? Thx.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[git-users] git diff shows some cpp file as binary and core.attributesfile has no effect

2011-02-03 Thread apostasia
using no attributes at all, here's part of the output of log 
--decorate=short --source  --graph --pretty=oneline --stat:
 
* 1f0a8441a99478a62fc71d29373ae3f3ad217862  HEAD commitmessage
|  somefile.cpp   |  Bin 577366 -> 578276 bytes
|  otherfile.cpp  |  356 
+++--
 
Which raises question 1: why does git treat somefile.cpp as binary, while 
otherfile.cpp is treated as text?
 
 
When using either .gitattributes or $GIT_DIR/info/attributes with *.cpp 
-text crlf diff, I get the desired results:
 
 * 1f0a8441a99478a62fc71d29373ae3f3ad217862  HEAD commitmessage
|  somefile.cpp   |  26  ++-
|  otherfile.cpp  |  356 
+++--
 
I would like to apply this globally: create a gitattributes in my home dir 
and let git know it's there by setting the option in ~/.gitconfig:
core.attributesfile = ~/gitattributes
This has no effect however, for no repository. Hence the second question: 
why would git not use the main attributes file?
I use Cygwin as a shell, and use the Msysgit distribution, with msysgit /bin 
added to Cygwin's PATH. Using Msysgit's git-bash.bat shell makes no 
difference though.
 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] git diff not working

2009-11-04 Thread Martin Guetlein

Hello,

the output of 'git diff' is always empty.
Even though 'git status' shows modified files, and whether or not I
already added the changes to be committed (via git add).

I'm working on a 'development' branch, but its not working on the
master branch either.

I'm using Ubuntu 9.04 and just installed git version git version
1.6.5.2 by hand (it did not solve my problem).

Hope someone can help me, I'm rather desperate

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en
-~--~~~~--~~--~--~---



[git-users] Git Diff GUI

2009-10-28 Thread artem

Hello! Tell me please if there some nice and usefull gui to make git
diff between two commits. Is it possbile in Eclipse/egit or in any
another gui tool? I did not found any way to do this yet.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en
-~--~~~~--~~--~--~---



[git-users] git diff with external

2009-09-21 Thread Jeenu

Hi,

I have a wrapper script whose name I've set to the diff.external
configuration. But I tend to use the internal diff often but now have
to pass the --no-ext-diff option every time I want to view a normal
diff. Is there a way to have the --ext-diff as the default option, but
still keeping the script's name in diff.external config?

Thanks
:J
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en
-~--~~~~--~~--~--~---



[git-users] git diff of previous commit that affects a particular file?

2008-09-23 Thread [EMAIL PROTECTED]

Is there an easy way to say "diff against the most recent commit that
affected this file"? If I do git diff HEAD^ , it diffs against
the previous commit to the repository as a whole, but that commit may
not have affected . For example, I may commit to file changes to
file X, commit changes to file Y, then commit changes to file Z. If I
want to diff file X against the previous revision of file X, I'd have
to do 'git diff HEAD~3' (or manually look through the log for the
commit id), but that assumes I know that the previous commit that
affected file X was 3 commits ago.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en
-~--~~~~--~~--~--~---