forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 157
Organize mingw includes #1985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dscho
wants to merge
2
commits into
gitgitgadget:master
Choose a base branch
from
dscho:organize-mingw-includes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+15
−15
Open
Organize mingw includes #1985
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
#define USE_THE_REPOSITORY_VARIABLE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Johannes Sixt wrote (reply to this): Am 09.10.25 um 09:46 schrieb Johannes Schindelin via GitGitGadget:
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> We want to make them relative to the top-level directory.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> compat/mingw.c | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/compat/mingw.c b/compat/mingw.c
> index 8538e3d172..da99473f56 100644
> --- a/compat/mingw.c
> +++ b/compat/mingw.c
> @@ -1,22 +1,22 @@
> #define USE_THE_REPOSITORY_VARIABLE
> #define DISABLE_SIGN_COMPARE_WARNINGS
>
> -#include "../git-compat-util.h"
> +#include "git-compat-util.h"
> #include "win32.h"
> #include <aclapi.h>
> #include <sddl.h>
> #include <conio.h>
> #include <wchar.h>
> -#include "../strbuf.h"
> -#include "../run-command.h"
> -#include "../abspath.h"
> -#include "../alloc.h"
> +#include "strbuf.h"
> +#include "run-command.h"
> +#include "abspath.h"
> +#include "alloc.h"
> #include "win32/lazyload.h"
> -#include "../config.h"
> -#include "../environment.h"
> -#include "../trace2.h"
> -#include "../symlinks.h"
> -#include "../wrapper.h"
> +#include "config.h"
> +#include "environment.h"
> +#include "trace2.h"
> +#include "symlinks.h"
> +#include "wrapper.h"
> #include "dir.h"
> #include "gettext.h"
> #define SECURITY_WIN32
Why is this needed?
With #include "foo" it is quite clear that the file is first looked up
from the directory of the file being processed. The changed code
requires that the top-level directory is among the -I directives of the
command lines. Then it would be much more logical to use #include <foo>
instead. But that I wouldn't regard as desirable, either, because the
included file isn't from a subordinate module or library.
So, IMO, the status quo is perfect and does not need this change.
-- Hannes
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Junio C Hamano wrote (reply to this): Johannes Sixt <j6t@kdbg.org> writes:
> Why is this needed?
;-)
As pointed out by Matthias, the changes in the posted patch are not
complete/comprehensive.
> With #include "foo" it is quite clear that the file is first looked up
> from the directory of the file being processed. The changed code
> requires that the top-level directory is among the -I directives of the
> command lines. Then it would be much more logical to use #include <foo>
> instead.
I actually prefer that, but that is a taste thing I do not want to
impose on this project.
> So, IMO, the status quo is perfect and does not need this change.
I tend to agree, but it would be a waste of time to further discuss
on this. As long as it does not break compilation, I'll just let
the patch graduate.
My preference is to
* always name custom headers using the path from the top-level (we
use -I in BASIC_CFLAGS exactly for this purpose),
e.g.
#include "compat/win32.h" (good)
#include "win32.h" (not good)
* compat header that aims to replace system supplied headers like
<regex.h> should use -I appropriately and appear as if they are
from the system, e.g.
#include <regex.h> (good)
#include "compat/regex/regex.h" (not good)
If somebody truly wants to improve things once the dust settles from
these patches, I would appreciate they keep the above in mind.
THanks. |
||
#define DISABLE_SIGN_COMPARE_WARNINGS | ||
|
||
#include "../git-compat-util.h" | ||
#include "git-compat-util.h" | ||
#include "abspath.h" | ||
#include "alloc.h" | ||
#include "config.h" | ||
#include "dir.h" | ||
#include "environment.h" | ||
#include "gettext.h" | ||
#include "run-command.h" | ||
#include "strbuf.h" | ||
#include "symlinks.h" | ||
#include "trace2.h" | ||
#include "win32.h" | ||
#include "win32/lazyload.h" | ||
#include "wrapper.h" | ||
#include <aclapi.h> | ||
#include <sddl.h> | ||
#include <conio.h> | ||
#include <wchar.h> | ||
#include "../strbuf.h" | ||
#include "../run-command.h" | ||
#include "../abspath.h" | ||
#include "../alloc.h" | ||
#include "win32/lazyload.h" | ||
#include "../config.h" | ||
#include "../environment.h" | ||
#include "../trace2.h" | ||
#include "../symlinks.h" | ||
#include "../wrapper.h" | ||
#include "dir.h" | ||
#include "gettext.h" | ||
#include <sddl.h> | ||
#define SECURITY_WIN32 | ||
#include <sspi.h> | ||
#include <wchar.h> | ||
#include <winternl.h> | ||
|
||
#define STATUS_DELETE_PENDING ((NTSTATUS) 0xC0000056) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Matthias Aßhauer wrote (reply to this):