8

The file naaclhlt2016.tex is not empty on the client or in the repository, however GitHub Desktop displays "This file is empty". What could explain this?

enter image description here

The file naaclhlt2016.tex is present on GitHub repository:

enter image description here

git status:

enter image description here

It creates conflict when I try to sync:

enter image description here

10
  • Is this a new file, not yet pushed? Commented Jan 2, 2016 at 4:19
  • @VonC The file naaclhlt2016.tex is present on GitHub repository. Commented Jan 2, 2016 at 5:09
  • Is it present in a different path? Is there any case difference anywhere in the path or name? Commented Jan 2, 2016 at 5:11
  • @VonC same path, same case. Commented Jan 2, 2016 at 5:17
  • What does a git status says, when using the command line? Commented Jan 2, 2016 at 5:20

3 Answers 3

8

After discussion, if the change of the tex file is only in term of metadata (and not actual file content change, after a latex recompilation), the GitHub Desktop might be unable to display any change.

Since it detects no change even though the git status list this file, it falls back to a "this file is empty" message.

Sign up to request clarification or add additional context in comments.

8 Comments

That might be a bug or at least a surprising "feature" to report to GitHub support, and see if they think it is the expected response.
I will report, but first I will try to understand why compiling a tex file with Texmaker changes the “date modified” meta-information. I will let you know when I submit the report.
@FranckDernoncourt Did you get any feedback from gitHub support about this feature?
Sorry, I forgot whether I had submitted a report. I have just submitted one. Thanks for the follow-up.
"That may not be the intended behavior, but I am not sure. I have shared your feedback with our team for them to consider."
|
1

I'm finding similar results when there is a mismatch between the autoCRLF setting (e.g. in ~/.gitconfig) and the storage of line breaks in a text file. I have .php files that were downloaded on one (Windows) machine, zipped up and unzipped in an Apache folder, then I copied those to a cloned repo and it sometimes complains about every file as changed. The files stored on GitHub seem to have been stored with CRLF (they are larger).

I have been unable to get GitHub Desktop to process my modified files. I have tried a full fresh clone with autoCRLF=true, autoCRLF=input, and autoCRLF=false, and yet GitHub Desktop either reports the files as empty or every line changed, depending on the autoCRLF setting.

I believe it is entirely because they were stored on GitHub with the CRLFs in the files, and GitHub Desktop seems to assume that the autoCRLF governs (only) the checked out files, and won't compare with CRLFs on GitHub, even with autoCRLF=false. They are byte-for-byte identical files, but they are LF-only, and it's either complaining every line has changed, or that the file is empty.

If I do a git diff on one of the files, in this case feed.php, I see: warning: CRLF will be replaced by LF in API/events/feed.php. The file will have its original line endings in your working directory.

Comments

1

In addition to the @VonC response.

To dissmiss this alert

Git desktop

  1. unselect all changed files

  2. select only the "this file is empty" files

  3. try to commit

  4. Git will display a commit error, saying that you can't do that. After closing the modal, Git should delete the files from the changes list.

1 Comment

I'd say this is the "solution" to this strange issue. Indeed trying to commit only these files results in an error, the commit is not done and the problem is gone. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.