Skip to content

Commit 30cf191

Browse files
committed
Merge branch 'js/vscode'
Add a script (in contrib/) to help users of VSCode work better with our codebase. * js/vscode: vscode: let cSpell work on commit messages, too vscode: add a dictionary for cSpell vscode: use 8-space tabs, no trailing ws, etc for Git's source code vscode: wrap commit messages at column 72 by default vscode: only overwrite C/C++ settings mingw: define WIN32 explicitly cache.h: extract enum declaration from inside a struct declaration vscode: hard-code a couple defines contrib: add a script to initialize VS Code configuration
2 parents 88f2407 + 12861e2 commit 30cf191

File tree

6 files changed

+405
-12
lines changed

6 files changed

+405
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
/config.mak.autogen
208208
/config.mak.append
209209
/configure
210+
/.vscode/
210211
/tags
211212
/TAGS
212213
/cscope*

cache.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,18 +1423,20 @@ extern void *read_object_with_reference(const struct object_id *oid,
14231423
extern struct object *peel_to_type(const char *name, int namelen,
14241424
struct object *o, enum object_type);
14251425

1426+
enum date_mode_type {
1427+
DATE_NORMAL = 0,
1428+
DATE_RELATIVE,
1429+
DATE_SHORT,
1430+
DATE_ISO8601,
1431+
DATE_ISO8601_STRICT,
1432+
DATE_RFC2822,
1433+
DATE_STRFTIME,
1434+
DATE_RAW,
1435+
DATE_UNIX
1436+
};
1437+
14261438
struct date_mode {
1427-
enum date_mode_type {
1428-
DATE_NORMAL = 0,
1429-
DATE_RELATIVE,
1430-
DATE_SHORT,
1431-
DATE_ISO8601,
1432-
DATE_ISO8601_STRICT,
1433-
DATE_RFC2822,
1434-
DATE_STRFTIME,
1435-
DATE_RAW,
1436-
DATE_UNIX
1437-
} type;
1439+
enum date_mode_type type;
14381440
const char *strftime_fmt;
14391441
int local;
14401442
};

config.mak.uname

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
528528
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
529529
compat/win32/pthread.o compat/win32/syslog.o \
530530
compat/win32/dirent.o
531-
BASIC_CFLAGS += -DPROTECT_NTFS_DEFAULT=1
531+
BASIC_CFLAGS += -DWIN32 -DPROTECT_NTFS_DEFAULT=1
532532
EXTLIBS += -lws2_32
533533
GITLIBS += git.res
534534
PTHREAD_LIBS =

contrib/vscode/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
init.sh whitespace=-indent-with-non-tab

contrib/vscode/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Configuration for VS Code
2+
=========================
3+
4+
[VS Code](https://code.visualstudio.com/) is a lightweight but powerful source
5+
code editor which runs on your desktop and is available for
6+
[Windows](https://code.visualstudio.com/docs/setup/windows),
7+
[macOS](https://code.visualstudio.com/docs/setup/mac) and
8+
[Linux](https://code.visualstudio.com/docs/setup/linux). Among other languages,
9+
it has [support for C/C++ via an extension](https://github.com/Microsoft/vscode-cpptools).
10+
11+
To start developing Git with VS Code, simply run the Unix shell script called
12+
`init.sh` in this directory, which creates the configuration files in
13+
`.vscode/` that VS Code consumes. `init.sh` needs access to `make` and `gcc`,
14+
so run the script in a Git SDK shell if you are using Windows.

0 commit comments

Comments
 (0)