# Git GUI Guesses Incorrect Language

3 messages from 2016-07-09 to 2016-07-09. Participants: Sunjay Varma, Johannes Sixt.
Thread: https://gitlist.dev/t/42806

## Sunjay Varma, 2016-07-09 04:57

Subject: Git GUI Guesses Incorrect Language
Message-ID: <CAJaQC31Su7NKd46cD81HE2OvC=O09aon12k8HFV29def4BAYfw@mail.gmail.com>
URL: https://gitlist.dev/e/CAJaQC31Su7NKd46cD81HE2OvC%3DO09aon12k8HFV29def4BAYfw%40mail.gmail.com

```
Here is a screenshot of what I am talking about: http://i.imgur.com/9ZRkeYF.png

This is the `git gui` program.

Just before the first line of my code, it says "C++ source, ASCII text".
That file is a JavaScript/ES6 file. The ".jsx" file extension
signifies that it may also contain Facebook's special JSX syntax
(HTML-like syntax in JavaScript).

Interestingly enough, my other files (http://i.imgur.com/L0qCRO4.png)
seem to get guessed fine. This file is only shown as "ASCII text".
That one file just seems to be a false positive.

Here's the file that gets incorrectly reported as C++:
https://github.com/sunjay/snake/blob/33bb6135b7bc4f6a958c3fdf51162f86e4cdf508/src/models/pathPlan.jsx

Here's the file that is only reported as "ASCII text":
https://github.com/sunjay/snake/blob/33bb6135b7bc4f6a958c3fdf51162f86e4cdf508/src/services/ai.jsx

Both files were unstaged when this occurred. There is no line at the
top for any files that are just modified.

Not a huge deal at all, but still a bug as this code is not C++ at all.

Cheers,
Sunjay

```

## Johannes Sixt, 2016-07-09 06:57

Subject: Re: Git GUI Guesses Incorrect Language
Message-ID: <5780A06A.8030901@kdbg.org>
URL: https://gitlist.dev/e/5780A06A.8030901%40kdbg.org
In-Reply-To: <CAJaQC31Su7NKd46cD81HE2OvC=O09aon12k8HFV29def4BAYfw@mail.gmail.com>

```
Am 09.07.2016 um 06:57 schrieb Sunjay Varma:
> Just before the first line of my code, it says "C++ source, ASCII text".
> That file is a JavaScript/ES6 file. The ".jsx" file extension
> signifies that it may also contain Facebook's special JSX syntax
> (HTML-like syntax in JavaScript).

Git-gui just delegates to the 'file' command. What does

   file src/models/pathPlan.jsx src/services/ai.jsx

report? If that guesses wrongly in the same way, then the authors of the 
file command are the right address for your complaint.

-- Hannes


```

## Sunjay Varma, 2016-07-09 06:59

Subject: Re: Git GUI Guesses Incorrect Language
Message-ID: <CAJaQC330QPR9h_iZW1amRxkJ8WGnoujdKA8fN49OWdMKUp6gTw@mail.gmail.com>
URL: https://gitlist.dev/e/CAJaQC330QPR9h_iZW1amRxkJ8WGnoujdKA8fN49OWdMKUp6gTw%40mail.gmail.com
In-Reply-To: <5780A06A.8030901@kdbg.org>

```
Seems like a file command issue then.

Here's the 'file' command output:

  $ file src/models/pathPlan.jsx src/services/ai.jsx
  src/models/pathPlan.jsx: C++ source, ASCII text
  src/services/ai.jsx:     ASCII text

Sunjay

On Sat, Jul 9, 2016 at 2:57 AM, Johannes Sixt <j6t@kdbg.org> wrote:
> Am 09.07.2016 um 06:57 schrieb Sunjay Varma:
>>
>> Just before the first line of my code, it says "C++ source, ASCII text".
>> That file is a JavaScript/ES6 file. The ".jsx" file extension
>> signifies that it may also contain Facebook's special JSX syntax
>> (HTML-like syntax in JavaScript).
>
>
> Git-gui just delegates to the 'file' command. What does
>
>   file src/models/pathPlan.jsx src/services/ai.jsx
>
> report? If that guesses wrongly in the same way, then the authors of the
> file command are the right address for your complaint.
>
> -- Hannes
>

```
