Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Mislav Marohnić b20cb4e1f1 Avoid `copy` when making a subslice 2018-05-29 12:31:14 +02:00
Tom 6f56756043 Use copy() to copy args values 2018-04-24 13:18:24 -04:00
Tom d6c1eb72c7 Set array size to known number of args 2018-04-24 12:39:10 -04:00
Elliott Beach 6261fbd94d pass file descriptors to cmd.NewWithArray 2017-08-04 18:16:16 -05:00
James Rouzier d937d28703 Set the stdin for the child process instead of reset the stdin of the parent process 2017-06-21 16:57:30 -04:00
Mislav Marohnić 854d86ccbe Ensure that "command not found" error is printed on stderr
Otherwise, for example, a `browse` command would have failed silently if
the program for the browser couldn't be found.

Ref. f507de0596

Fixes #1289
2016-10-03 19:12:05 +02:00
Mislav Marohnić b78bc1d1e1 Ensure that verbose logging always happens in `Exec()`
Ref. #1289
2016-10-03 18:54:35 +02:00
Mislav Marohnić c3ddec3248 Improve detecting local clone resources
In `hub clone NAME`, "NAME" was previously considered a local resource
if a directory of the same name existed, and the clone command was left
unchanged.

That worked for a while, but some users were surprised that they
couldn't clone their repo named "NAME", only to discover that there was
an unrelated directory "NAME" in the current working directory.

Also, a git bundle is a valid cloneable resource, but is a file and not
a directory.

This refines the detection of cloneable resources. "NAME" is considered
to be locally cloneable if one of the following is true:

- "NAME/.git" exists
- "NAME" is a bare git repo
- "NAME" is a file whose first line includes "git bundle"
2016-01-22 20:47:51 +11:00
Mislav Marohnić 1b862e3388 Switch from godep & rewriting import paths to GO15VENDOREXPERIMENT 2016-01-20 14:46:44 +11:00
Mislav Marohnić dbb5f06911 Have `HUB_VERBOSE` also log externally run commands 2015-10-31 01:45:20 +01:00
Jingwen Owen Ou d99f308e2d Don’t trim empty string arguments when building command
Empty string arguments are removed when building an executable command, causing problems like https://github.com/github/hub/issues/725. However, we need to remove empty string arguments constructed from the commands layer, e.g., https://github.com/github/hub/blob/master/commands/browse.go#L112. We fix it by moving the removal logic to `Args.ToCmd`.
2014-12-09 08:44:03 -08:00
Jingwen Owen Ou 4cb663a968 Rename `Cmd.ExecOutput` to `Cmd.CombinedOutput` to avoid confusion
We now have `Cmd.Spawn` and `Cmd.Exec`, to avoid confusion, we use `Cmd.CombinedOutput` for combined output.
2014-11-30 12:16:53 -08:00
Jingwen Owen Ou 0ed14758b7 Use `Exec` except Windows for the last command run in the commands chain
This is to avoid the interrupt/pagination issues like https://github.com/github/hub/issues/708. Note that `exec(3)` is not available on Windows: http://golang.org/src/pkg/syscall/exec_windows.go#L339. A fall to `spawn(3)` is used in this case.
2014-11-30 12:14:18 -08:00
Jingwen Owen Ou 8cd1ba849d Rename `Cmd.Exec` to `Cmd.Spawn`
This is to `spawn` a process not to `exec` one
2014-11-30 11:15:13 -08:00
Jingwen Owen Ou 6137851f15 Vendor dependencies by rewriting import paths 2014-11-30 09:16:57 -08:00
Jingwen Owen Ou 498789a999 Change namespace to github/hub 2014-02-10 08:29:03 -08:00
Jingwen Owen Ou 333cae20ab Use shell quote for exec cmd 2013-11-26 07:14:47 -08:00
Jingwen Owen Ou fa8f2c95a7 Spawning processes to run git commands; Exec(1) doesn't work on Windows... 2013-09-22 17:51:37 -07:00
Jingwen Owen Ou c980c10c1e Revert "Remove sysexec since Windows doesn't support it…:-("
This reverts commit d527efb3f83de97c111dd2a2867e72aaa4cd5678.
2013-09-21 07:33:22 -07:00
Jingwen Owen Ou e0b66f06db Remove sysexec since Windows doesn't support it…:-( 2013-09-20 15:13:11 -07:00
Jingwen Owen Ou 87430090a9 Enable noop 2013-07-05 11:10:24 -07:00
Jingwen Owen Ou 13240c7021 Implement merge 2013-07-02 11:28:50 -07:00
Jingwen Owen Ou ff5b5ce6d7 Fallthrough to git if no commands match 2013-06-28 16:49:49 -07:00
Jingwen Owen Ou 8a0e224b4f Extract to remote.go 2013-06-24 13:43:59 -07:00
Jingwen Owen Ou 022d899c2b Implement add remote for current user 2013-06-21 18:02:29 -07:00
Jingwen Owen Ou c3adf47be6 Finish git remote command 2013-06-17 13:35:02 -07:00
Jingwen Owen Ou 6cdb7e2e11 Implement gh browse 2013-05-31 16:32:30 -07:00
Jingwen Owen Ou 64fa816809 Move code to proper subpackages 2013-05-29 12:01:12 -07:00