git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] typo DWIMery with alias broken (cd to random dir)
@ 2016-01-26  7:37 Michael J Gruber
  2016-01-26 12:50 ` Duy Nguyen
  2016-01-26 13:26 ` [PATCH] git.c: fix help.autocorrect after 57ea712 breaks it Nguyễn Thái Ngọc Duy
  0 siblings, 2 replies; 22+ messages in thread
From: Michael J Gruber @ 2016-01-26  7:37 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Nguyen Thai Ngoc Duy

Hi there,

with current next (989ee58 plus local additions) it seems that typo
DWIMery with aliases is broken, see below.

It appears that the typo DWIMery is broken only when there is a unique
automatic DWIM substitution for a mistyped alias.

I haven't bisected yet, but I suspect this to be related to recent
changes regarding the environment in which commands/aliases are started
(though this happens without extra work trees), so I'm cc'ing an expert
in that area. Funny, though, that my user name shows up...

I think the reason is that git.c's handle_alias() (or something else)
calls restore_env() multiple times, and restore_env frees orig_cwd such
that subsequent restore_env(0) with external_alias=0 tries to cd to a
random location.

I have no idea whether orig_cwd=0 after freeing or something else would
be the proper fix.

Michael

LANG=C git sss
WARNING: You called a Git command named 'sss', which does not exist.
Continuing under the assumption that you meant 'ss'
in 2.0 seconds automatically...
fatal: could not move to git@drmicha.warpmail.net: No such file or directory
[mjg@skimbleshanks git]✗ LANG=C git ss
## HEAD (no branch)
?? a
?? a.patch
?? c2d.sh
[mjg@skimbleshanks git]✓ LANG=C git statu -sb
git: 'statu' is not a git command. See 'git --help'.

Did you mean one of these?
        status
        stage
        stash
[mjg@skimbleshanks git]✗ LANG=C git statuss -sb
WARNING: You called a Git command named 'statuss', which does not exist.
Continuing under the assumption that you meant 'status'
in 2.0 seconds automatically...
## HEAD (no branch)
?? a
?? a.patch
?? c2d.sh

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-02-03  2:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-26  7:37 [BUG] typo DWIMery with alias broken (cd to random dir) Michael J Gruber
2016-01-26 12:50 ` Duy Nguyen
2016-01-26 13:26 ` [PATCH] git.c: fix help.autocorrect after 57ea712 breaks it Nguyễn Thái Ngọc Duy
2016-01-26 14:39   ` Michael J Gruber
2016-01-26 17:44     ` Junio C Hamano
2016-01-26 19:02   ` Junio C Hamano
2016-01-26 20:11   ` Junio C Hamano
2016-01-27  6:49     ` Junio C Hamano
2016-01-27  6:50       ` [PATCH 2/3] git: protect against unbalanced calls to {save,restore}_env() Junio C Hamano
2016-01-27 23:19         ` [PATCH v2 " Junio C Hamano
2016-01-27  6:52       ` [PATCH 3/3] git: simplify environment save/restore logic Junio C Hamano
2016-01-27 23:22         ` [PATCH v2 " Junio C Hamano
2016-01-27 23:47           ` Junio C Hamano
2016-01-27  9:14       ` [PATCH] git.c: fix help.autocorrect after 57ea712 breaks it Duy Nguyen
2016-01-27 12:01         ` Junio C Hamano
2016-01-27 23:18           ` [PATCH v2 1/3] git: remove an early return from save_env_before_alias() Junio C Hamano
2016-02-02 23:47             ` [PATCH v3 1/4] " Junio C Hamano
2016-02-02 23:47             ` [PATCH v3 2/4] git: protect against unbalanced calls to {save,restore}_env() Junio C Hamano
2016-02-02 23:48             ` [PATCH v3 3/4] git: simplify environment save/restore logic Junio C Hamano
2016-02-02 23:50             ` [PATCH v3 4/4] restore_env(): free the saved environment variable once we are done Junio C Hamano
2016-02-03  1:47               ` Eric Sunshine
2016-02-03  2:19                 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).