Skip to contentSkip to conversation

Bug Report with Git Bash

DISCUSSION [email protected] 2 participants 4 messages Mar 19, 2023 – Mar 28, 2023 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Dear Git community,
I have observed a bug related to git bash at my end. Please the following description.
Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) Please note that 'ls' command just an example, it's happening with any command.
This is a relatively simple bug. when we double-type a command, like 'ls'. However, in the Ubuntu environment, the command only occurs once when we press the top arrow to use the prior command.
It is identical when using git bash.
Repeat these steps:
Type "ls: in git bash.
2. Type "ls" once more.
3. To return to the previous command, use the top arrow.
As you can see, the number of times we type the can command 'ls' does not matter; it only needs to occur once.
Please be aware that the command "ls" is only an example; this can happen with any command.

What did you expect to happen? (Expected behavior)
It's only need to appear once time and remove duplicated for more convenience.

What happened instead? (Actual behavior)
It's depending on how many times we type that command.

What's different between what you expected and what actually happened? As described above.
Anything else you want to add:

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.

[System Info]
git version:
git version 2.33.0.windows.2
cpu: x86_64
built from commit: 8735530946cced809cc6cc4c2ca3b078cdb3dfc8
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Windows 10.0 22621
compiler info: gnuc: 10.3
libc info: no libc information available
$SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks]

--
Thanks and Best Regards!
---------------------------------------------------
Sang Truong Tan

Department of Electronics
HCMC University of Technology
Phone: (+84) 977 600 563 or (+84) 908 983 574
Email: [email protected]

A message that is not in the archive (sent off-list or not yet received): CAN0heSqEH+AtzXcybPY-Jd-bRtgtKmGrfxbXL-adsvjr_srEZw@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Dear Martin,
What a very quick response!
I just tried your recommendation, and it works.
There is no word that can explain my appreciation, to be honest! Thanks a million.

--
Thanks and Best Regards!
---------------------------------------------------
Sang Truong Tan

Department of Electronics
HCMC University of Technology
Phone: (+84) 977 600 563 or (+84) 908 983 574
Email: mailto:[email protected]

From: Martin Ågren <mailto:[email protected]>
Sent: Sunday, March 19, 2023 7:28 PM
To: mailto:[email protected]
Cc: mailto:[email protected]
Subject: Re: Bug Report with Git Bash

Hi,

On Sunday, 19 March 2023, <mailto:[email protected]> wrote:
This is a relatively simple bug. when we double-type a command, like 'ls'. However, in the Ubuntu environment, the command only occurs once when we press the top arrow to use the prior command.
It is identical when using git bash.
Repeat these steps:
Type "ls: in git bash.
2. Type "ls" once more.
3. To return to the previous command, use the top arrow.
As you can see, the number of times we type the can command 'ls' does not matter; it only needs to occur once.

This depends on how your shell is configured.

Look into HISTCONTROL and ignoredups.

You might want something like

export HISTCONTROL=ignoredups

in ~/.bashrc.

Martin

#4 lore raw

Hi,

FWIW the reason why you see it in your Ubuntu setup is most likely rooted in the /etc/skel/.bashrc file that contains this:

# don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options
HISTCONTROL=ignoreboth

Ciao,
Johannes

Quoted 49 lines · On Sun, 19 Mar 2023, [email protected] wrote:

Dear Martin,
What a very quick response!
I just tried your recommendation, and it works.
There is no word that can explain my appreciation, to be honest! Thanks a million.

--
Thanks and Best Regards!
---------------------------------------------------
Sang Truong Tan

Department of Electronics
HCMC University of Technology
Phone: (+84) 977 600 563 or (+84) 908 983 574
Email: mailto:[email protected]

From: Martin Ågren <mailto:[email protected]>
Sent: Sunday, March 19, 2023 7:28 PM
To: mailto:[email protected]
Cc: mailto:[email protected]
Subject: Re: Bug Report with Git Bash

Hi,

On Sunday, 19 March 2023, <mailto:[email protected]> wrote:
This is a relatively simple bug. when we double-type a command, like 'ls'. However, in the Ubuntu environment, the command only occurs once when we press the top arrow to use the prior command.
It is identical when using git bash.
Repeat these steps:
Type "ls: in git bash.
2. Type "ls" once more.
3. To return to the previous command, use the top arrow.
As you can see, the number of times we type the can command 'ls' does not matter; it only needs to occur once.

This depends on how your shell is configured.

Look into HISTCONTROL and ignoredups.

You might want something like

export HISTCONTROL=ignoredups

in ~/.bashrc.

Martin

#5 lore raw

Dear Johannes,
Thanks a lot for your information.

--
Thanks and Best Regards!
---------------------------------------------------
Sang Truong Tan

Department of Electronics
HCMC University of Technology
Phone: (+84) 977 600 563 or (+84) 908 983 574
Email: [email protected]

-----Original Message-----
From: Johannes Schindelin <[email protected]>
Sent: Monday, March 27, 2023 2:17 PM
To: [email protected]
Cc: [email protected]; [email protected]
Subject: RE: Bug Report with Git Bash

Hi,

FWIW the reason why you see it in your Ubuntu setup is most likely rooted in the /etc/skel/.bashrc file that contains this:

# don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options
HISTCONTROL=ignoreboth

Ciao,
Johannes

Quoted 49 lines · On Sun, 19 Mar 2023, [email protected] wrote:

Dear Martin,
What a very quick response!
I just tried your recommendation, and it works.
There is no word that can explain my appreciation, to be honest! Thanks a million.

--
Thanks and Best Regards!
---------------------------------------------------
Sang Truong Tan

Department of Electronics
HCMC University of Technology
Phone: (+84) 977 600 563 or (+84) 908 983 574
Email: mailto:[email protected]

From: Martin Ågren <mailto:[email protected]>
Sent: Sunday, March 19, 2023 7:28 PM
To: mailto:[email protected]
Cc: mailto:[email protected]
Subject: Re: Bug Report with Git Bash

Hi,

On Sunday, 19 March 2023, <mailto:[email protected]> wrote:
This is a relatively simple bug. when we double-type a command, like 'ls'. However, in the Ubuntu environment, the command only occurs once when we press the top arrow to use the prior command.
It is identical when using git bash.
Repeat these steps:
Type "ls: in git bash.
2. Type "ls" once more.
3. To return to the previous command, use the top arrow.
As you can see, the number of times we type the can command 'ls' does not matter; it only needs to occur once.

This depends on how your shell is configured.

Look into HISTCONTROL and ignoredups.

You might want something like

export HISTCONTROL=ignoredups

in ~/.bashrc.

Martin